added universal module declaration style

Now the library works in requireJS and node.js without poluting the
global scope