Refactored text read/write and YAML parsing.