Fleshed out marshalling functions.

Started work on integrating with TCPClient