Extract xcore cli implemenation.

We want to house the implemenation of each function for the cli
tool into it's own file. For example build-client should be in
it's own .js as well as test, etc.
Merge in Chall's xcore cli fixes
Reconciled @chall client code. Stubbed usage.