Node.JS compatibility

Hello there!

I really liked this library, but I noticed it wasn't compatible with Node.JS in its current state, so I have now implemented that functionality, although I'm sure it could be cleaned up a little from my implementation.

When the library is executed now, it should detect if it is running within a node environment and if it is, it will act like a node module, otherwise it will fallback to the original browser and AMD detection, appending it to the window object.

This is my first time forking and contributing to someone else's project, so I hope I went about it the right way.