Refactoring and documentation

Hey dude.

Here is a refactored, OOP version.
Added compatibility with CommonJS and AMD too.

And some attached documentation too.

Have fun.

#YOLO