Fixed async compatibility of tests for browser.
Added cleanups in most tests. Fixed browser bugs in stardog.js.