Convert tests to JavaScript and add context object as an additional parameter that can be passed along

Note, currently missing test for the bundling and re-creation (server -> client). Will update the derby docs and make a PR there as well.