codec: support encoding non-addressable arrays.

arrays may be unaddressable, and thus we cannot get slice from them.
Consequently, we can't share the same method by grabbing a slice from the array.
Instead, we have to duplicate the methods.

Also, when encoding or decoding anything that looks like a sequence of bytes
([]byte, [X]byte), we should treat as raw bytes (which is what the user most likely
would expect).

Fixes #21 and Fixes #22 .