fix client auth + add logout

- Implement logout on client side
- Use localStorage instead of sessionStorage for more persistent state
- Fix some stupid bug that has something to do with React lifecycle. To
  be more specific: a listener function of 'login' now doesn't directly call
  self.setState(), it instead calls self.handleLogin(), which in turn
  should call self.setState() or whatever it wants. For some reason,
  this works. I have no idea why, but whatever...