reorganized client
changed to using Text instead of ByteString. TODO: generalize accepted protocols; fix bug where extra quotes and backslashes are encoded, causing transmitted JSON to be invalid