Make module common js compliant

Would be great to see this module also on NPM any time soon.