fixing localStorage by checking and using get/setItem

hasLocalStorage variable was insufficient for detecting support in Private Safari. Also switching to getItem and setItem as a polyfill can override that functionality, but cannot currently override getters/setters (maybe with ES6)