The yaml.SafeLoader.add_constructor() should probably only be done once, and moving this all into a module gives us an opportunity to test it directly.