Latest version
rationalised the msg send functions, added connection message sending functions
Added processing for connection state processing
Added comms states and _connectionState()
Now sets state to connected/disconnected