Added ability to send json messages.
Converted to using pick for serialization.
Added functions for sending and recieving data