refactoring to break up the file a bit
fixes test (uses auth)
refactoring test
finished refactoring to more pure unit tests
better testing of authentication