Refactor + indexeddb storage+backbone-relational.

Sorry all this is in one commit, lots of hacking around getting used to
indexeddb and backbone-relational for the first time.