Use TreeForeignKey in test app models.

Closes #339