Add return codes to help output, put writable config in main function