Big refactor to do b-tree inserts and introduce safety

Major ideas:
- Inserts via a B+-tree (to support collapsing)
- Row collapsing now works
- Flushes occur every N minutes
- Writers only read immutable state on disk
- Readers and writers don't do data races (at least by design)
- Code split out into files, mostly by type groups
- Many new safety checks

Big remaining todos:
- Tests still WIP (see ignored files)
- Server and migrator have to be updated
- Readme updates