212 unique ids

Rather a large refactoring, but still more coming. There is a known issue with local blocks getting replicated on save/restore, but that will be fixed shortly as part of a different issue.