HTML test environment and first version of javascript api

This will override existing callbacks registered. Perhaps locomote.callbacks[this.id][eventName] should be an array of callbacks instead.