refactoring

Initial work to turn library into commonjs style and work on code cleanup/testing

This pull request is more about discussion than any one single feature or update. Overall, I would like to simplify and overhaul many parts of this library while also adding more tests. I also think that things like jsbn and crypto related items need to live in separate modules. This is more idiomatic to modular development and allow for those pieces to be tested separately.

On the code simplification front, I would like to minimize the number of places were "magic" happens by allowing the user to pass in a wide variety of different arguments to constructors or other functions. This makes the API harder to use mentally as you constantly have to remember what calls accept which types of parameters. It also increases the testing surface of the API since you would need to test with the various parameter types. I think a goal should instead be to provide the building blocks that allow others to assemble the various components as they see fit. This includes pulling out things like the "wallet" feature, etc which are opinionated and complex components that don't really belong in lower level libs imho.