Refactor belongs-to for compatibility with 3.4

Closes #220