Implemented Commands

All passing of messages is now done via commands. Also did some reworks
of the command API (no longer needs to know the size of the command
before you encode it).