Store data in MongoDb instead of in memory.

Plus some misc. refactoring! :)
Minor SignalR tweaks.

Ensure SignalR is connected before trying to submit data, etc.