reimplemented marshaling so it generates an interface tree

generating struct trees won't work in the future when we're building
compound objects.