Fix Python 3 handling of urllib

Added try/except blocks to properly import moved methods in the
urllib and urllib2 modules. This would break things including `%load`ing
scripts by url and installing a local copy of MathJax.
Merge pull request #4553 from flacjacket/urllib_py3

Fix Python 3 handling of urllib