WIP: First attempt to run in node and browser with same spec tests

This is WIP pull-request. 

Contains some tricks to make same spec file that runs for node and browser jasmine test runner.