Automodapi option to write out what automodapi is actually doing

While trying to diagnose #1826, I ended up getting frustrated with a bunch of hacks I had to do to see what `automodapi` is doing.  So this adds an option to just write out the result of `automodapi` into the doc source directories.  Of course it's off by default, because we don't want it confusing people, but the option will be valuable for debugging sphinx warnings and extensions.