Simplify $localstorage API, other small changes