Ported to use commonJS module system, tests re-worked to use Jasmine with testem and Node.js