Tweaked the write class with a couple of minor edits, then merged server
and client into one file. Then, added thread support to avoid blocking.