Updates for Python 3.0 -> Python 2.0 compatibility

My development environment is Python 3, but the server this will be run on uses Python 2.  The most significant change made is the inclusion of the urllib2 library, which was removed in Python 3 (or, more accurately, consolidated into urllib).
Credit to Joe Roberts for making the necessary compatibility changes and for testing them.