Snapshot of WIP.
Big refactor of the random_adaptors code to remove unnecessary layering.
Also Yet Another Big Sweep Of Old code, essentially a rewrite of anything dodgy looking with my mind on efficiency. Some excess code is removed, and block copies are eliminated where possible.
Locking is broken. This will be fixed in a follow-up.