Implement encoding for tlv
also add test for encoding and for tlv with one known subfield/subcodc