Merge pull request #22 from swilliams/master

Improved hooks with inheritance. Cache for belongs_to.