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.