misc.rs
Put everything that was in `misc.rs` into their own files, with some opportunistic refactoring, because why not.