Long needed updates to JS code.

- Moved to jQuery 1.10
- Correctly handle hash change event to support
  back buttons
- Cleaned up js code a bit, moving out emoticon
  code into its own file.