refactor(store): externalize state in api
refactor(store): externalize state in helpers
refactor(store): externalize state in localstore
refactor(store): externalize state in bootstrap
refactor(hoodie): proper closure and dry code