Fixed import error in Python 3

Added conditional constant to detect Python 3. Python 3 moved unquote from `urllib` into `urllib.parse`. Added conditional methods to use `__str__` on Python 3.