5087 local storage message

Feedback welcome! Message can be saved and retrieved from localStorage.
@jhass @Raven24 

Thanks for the feedback! This is our first attempt at a backbone API :)

The problem we have been trying to solve is: autosaving a message without needing to press save so that if connection is lost or the page closes (or the modal closes), you do not lose your message. (let us know if this is different from your vision!)

Trying to solve this then, some of the drawbacks going down the Backbone.sync route that we could think of were:

Backbone.sync is the function that syncs the front end model with the rails model and will generally be called when either fetching or saving. 

Given that we want to autosave, so before pressing anything, it seemed to us to be not inside the object life-cycle of Backbone.sync to save automatically to localStorage.

One way, we could think of using Backbone.sync would be when fetching, sync would first check localStorage and not send an AJAX call to the server, but this is more complex than the implementation we have come up with (for a junior, anyway :) )

We have extracted the code we have written into an API, and will be looking at making aspects of it more generic (such as the key used), so your comments are more than welcome.

Thanks again for your hard work and input.