Cleaned-up the request encoding code and laid the groundwork for request decoding.