FIX: Reorganize modules

Ready for review/merge. Moves a bunch of stuff around. There could be minor improvements (e.g., by consolidating things in `io` in particular files), but that should be done in a subsequent PR to reduce reviewing burden.

Tests pass over here, and docs look good on build (including examples I re-ran).

Closes #445.
Closes #400.