Client Code Shift

Moved much of the code to the client but more work remains to be done in
this area.