there is a ton of `if (window.localStorage) { `in here. I think we can get rid of all the `if`s by either:

* Mocking `localStorage = {}` if it isn't available
* If that is too gross because it is messing with a global, create a `localLocalStorage` that does the same
* Create a function that takes a does the check. (`addToLocalStorage(val);` or similar)
* Leave it as is. whatevs.