Unit tests for userAuthenticate.js and fixes to existing unit tests.
Merge remote-tracking branch 'extendedmind/master'
Merged and fixed conflict