Refactor RLP codec for better clarity and some small memory savings.