Improve Map Performance

This pull request improves the performance when building the map through three means:
* Reducing the number of SQL queries to lookup a ConfigEntry
* Pulling all systems in a single SQL query then building the tree in Python (rather than a seperate SQL query for children of each system)
* Caching the map between changes

Note that input/output remains unchanged within these commits, only implementation details have changed.