Fix bug where submessages were not handled correctly. Also adds time primitive.
Adds duration primitive.