Use ObjectType in TreeEntry

We introduced a new type ObjectType, but TreeEntry is still using an int to represent the same thing. This patch fixes that.