* rewrite to support loading as module and standaalone
* small alterations at test.js , needs to be rewritten