Adding encoding utf8 to yaml dumping and C module when available for improving perf.