Refactor, add more tests

* tests for fallback to localstorage on error
* experimenting with versioning replacements...
* cleanup Gruntfile
cleanup
fix Gruntfile