Cleaned up a bit and made the JS work for signout again.