longurl.py: try to deal with percent encoded urls intelligently.
longurl.py: wrote test script
longurl.py: prevent test failures on different terminal widths
longurl.py: exit gracefully on Ctrl+C
longurl.py: simplified test script, added new tests
longurl.py: A little documenting, cleaning up.