Support for relative paths, and genindex/index.html in Sphinx

This adds index.html to the end of urls where required and removes a
level of relative path when parsing genindex/index.html.

I made this patch to support the subdirectory genindex/ used by
Saltstack for their docs. I have not tested this against other Sphinx
documentations so I can't vouch for its safety.