snag only the domain name in the URL and make histparse python2

Added urlformat function to only snag the domain name from URLs,
country codes as the top-level domain, and IPv4 addresses. Also
modified histparse.py to make it compatible with python2, since
the pygraphviz module does not support python3.