Fix session setting during testing. Test basic authentication modules and clean up test suite