Add fully functional login, logout and tests respectively