Using a conf.py file, revised code.

conf.py looks like the best way to configure Sphinx. Passing
configuration in dictionary makes it a pain to set up
extensions, and their configuration options properly.