!wip Rebase current master into dev branch

The `master` and `dev` branched had never been reconciled after they split. I'm now rebasing the `dev` branch so that it can take advantage of the latest changes in `master` as I intend to push it forward and get ready to become the next version of `Penthouse`.

The merge was complicated, and I haven't yet got all the functionality tests from `master` to work - (`2/10` fail). I'll fix this tomorrow.

(Commit history is a complete mess.. but that's okay, perhaps I'll clean it up before merging with `dev`, and then again before merging into `master`.)