Added redirects to the referer page when you login, logout or signup
Cleaned up redirect