Restructured and cleaned the CLI interfaces

[Issue #316]

* ui/rpc folder moved into ui/cli
* Moved duplicate code into cli/utilities.rb
* Massive cleanup of the RPC CLI client.