Use yaml.safe_dump instead of yaml.dump to coerce Python objects

This was outputting unicode strings as Python objects.
Fixed docstring for consistency with the actual file name