clean up tests, make them work in node + browser