Added protection around some send commands to make sure we're connected

Also began modifications on machine configuration. I need to design this
better.