Define ways to marshal typelib objects (models and values) as simple ruby values

This ensures that we can easily marshal them into JSON, YAML and friends.