Moved network request away from MainActivity.
Codec class for encoding / decoding requests.