refactored mysql_tools.py using pep8 + expanded commenting