Refactored Serializer to return ByteBuffer instead of ChannelBuffer in order to reduce exposure of underlyting Netty details.