Changed so the MessageStore does not directly set ThreadStore

* Move event handling code to MessageStore file since that file already
  depends on the ThreadStore.
* That resolved the node issues with the circular dependencies.
* Should the event handlers possibly go to a separate file?