Add a bunch of javascript tests.

There is more left to do, but this is a good start.