Cleaned up some code and changed the logout to use POST.