Use localforage and several other fixes