Massively refactor 'encodeTyped' to automatically cache

The new version caches values automatically, the old 'encodeTypedLike'
has been deprecated. If caching is undesirable due to the added payload,
the new encodeTyped' is exposed.
Always precache, sometimes preserialize (#33)

Precaching, i.e. the calculation of the type representation, is now
always shared among 'encodeTyped' invocations. When the type information
is long enough it is even precached, i.e. instead of storing the type
information directly, its serialized version is. This saves repeated
serializations of long and identical data, at the cost of 9 additional
bytes per serialization.
Fix tutorial to match new API (#34)
Merge improved caching mechanics