Include tests for localstorage and history api- tidy up the store factory a little.