pep8ify and refactor symbol.py