Move back to using Sphinx API to build.

We also did a little clean-up on the tool code.

Closes #52.