Refactor, add more tests

* tests for fallback to localstorage on error
* experimenting with versioning replacements...
* cleanup Gruntfile
cleanup
fix Gruntfile
Merge branch 'master' into gh-pages

* master:
  fix Gruntfile
  cleanup
  Refactor, add more tests