Move to file-based config, fix whatever was broken from before, general cleanup.