analytics.py: fixed a number of issues, also added ability to define the range
of connected nodes around a node to search for repeated connectors.