Add AMD/CMD module definition

Besides of AMD/CMD definition module is exposed globaly into the window.
This is done because when module is used in browser module.exports is
available so module thinks that it is required through require method.