Improved documentation. Switched to commonjs.

Improved documentation showing usage and simple examples.
Moved to commonjs module definition.