ENH: improved doc-link resolver

Improved doc-link resolver from scikit-learn/scikit-learn#1583 :

- Use the `searchindex.js` generated by Sphinx to resolve the links
- Links to scipy docs
- Support gzip-compressed web sites (matplotlib links are broken in the current master since they recently enabled compression).
- Some cleanup (use `with` statement, style)

I will also merge this into maint/0.5, so we can build the current website with links working.