Updated to be exportable module
Code now checking username correctly, mocha tests passing