Localstorage support

I think it might be nice to have support for local storage. This also integrates the local storage with the game state, making it easy to persist a game between sessions.