Add a way for each class to define relation providers

Needs a lot of renaming because it's kind of ridiculous right now ... but the feature is here.

Fixes #57