Refactor config file format, add some documentation.