Added hooks so you can add a type handler to the codec (discouraged, just use dtos!)

Signed-off-by: Peter Kriens <peter.kriens@aqute.biz>