Make ObjectByName work with Go types too.

Fixes #91.