added command-line config options for rpc

Rebased on top of latest master.