Changed from using localStorage to using cookies.
This is because localStorage won't work in Internet Explorer when loading from file://. Also, support for localStorage is not as good in older browsers. Cookies are fine - we'll probably never need to store so much data that the storage limit becomes an issue anyway.