refactor map into it's own namespace and using indexeddb for local storage