Convert to commonjs and browser compatable module definition