Changed the way the exports are defined.

If `modules` wasn't defined (for instance, when using a webapp) defining it and then adding an exports object to it is not very good as it's not needed unless the end user is using Node.JS