This fixes link nesting, and resolves some issues around links not closing
correctly. There were a few changes required to support the autotoc feature, and
the auto ref feature has be deprecated. This feature no longer is required, as
we are doing pending_xref natively. The functionality was breaking Sphinx
altogether, so it doesn't make sense to keep it and deprecate the feature.