Add field type serialization code

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>