Fix existing tests and add new tests

Also use webpack to build tests, vs browserify.