Logout exception handling added.
Testing improved.
MongoDB backend and functional testing: minor improvements.