Documentation improvements

This branch is not yet ready to merge. Fixes #303 (and maybe some others).

I'm going to be writing documentation in this branch, but as I go it might be nice to have this pull request for discussion.