check that window.localStorage exists
Merge pull request #2 from CamShaft/patch-1

check that window.localStorage exists