Enable some reasonable warnings.

There were a few cases of unused variables.
More comments.

Also, a new make doc target.
Ignore the doc/ directory (auto-generated documentation).