Added unit tests for token request, login attempt and file name check.

Less atomic than desired because of async nature of the operations, but better than no unit testing.