Migrated to new data structure
Still have bugs in the internal saving of the data structure to work out, but the basics are there.