Changed the way module exports itself, changed test file accordingly.

The previous structure for the module exporting its functionality was incorrect, and because of this the test file would not run. The test file now runs correctly, but you'll notice that logging in doesn't work. Sounds like some serious bug fixing/dev is in order. Let me know if there's anything I can help with, once you've tracked down the reason logging in doesn't work.