Restructure, split into client and server classes

Incidentally this adds remctl client support.