Lots of code reorganization. Move all protocol commands to commands.c