Genericized loading from YAML files