Added Universal Module Definition(UMD) and a better approach in getENV()

I was having problem when I used `lokijs` with `requirejs`.
He tried to load the `fs` lib on browser.