Added query level caching and refactored to allow easier dev of new repos