This is refactoring existing code only, with the goal of providing a common API for loading sites from sites.txt, usable by multiple tools.