Updated connection and improved messages

Updated the connection class and moved it into it's own file.
Connections and messages now have statuses associated with them and
messages can now be encoded and decoded with the extra data that they
need to identify various settings.