Add a shared header file and small bugfix

A shared header file has been created to house the shared global
variables and also the shared includes.  This allows a max buffer to be
implemented as a define that is easily changed.

The random characters after a message have been fixed by ensuring that
the server and client buffers are the same size.