Copied changes from Emscripten branch.

That are also relevant to this branch.
Added more types.
Lots of updates, most tests passing.

I've been able to get most of the tests passing, just a handful left.
There is a little manual intervention needed for most methods to get
them to compile correctly.

I'd love help on:

- Getting more methods compiled and tested!
- Code reviews.
- Testing the code!