beginning some code cleanup in cli.cpp, moved rpc configuration code into a separate function