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.~~ Since the docs seems to not be available in repo any more I won't update them with the new parameter addition.

Also fixes various issues with filters, such as not pushing updates (inserts/removes) properly to Derby / the UI / View. 

Also fixes issue with refLists.

My apologies for such a messy PR. It should have been split up into separate ones on different branches. Unfortunately now it's such a mess for me to fix it that I'll have to wait until you guys accept it... ;-)