added comments
added test initialization
added exception type for testing classes
implemented tests
restricted access to redirectAndExit() in testing scenarios