changed generate to use nodejs crypto, added weakgenerate, added async support for generate, and added tests