Refactor / modernize config parsing with configfile helpers

... as requested by @octo