Cleaned up symbols.py code, added a test for it.