HTML test environment and first version of javascript api

Fixed - moved it to jslib.