JavaScript abstraction of localStorage