Simplify the module definition

And use JS to our advantage in getting necessary source for browser