getCon.py: Fix a typo
getCon.py: Refactor to use functions
getCon.py: Simplify for readability
getCon.py: Add support for checking topology against structure