Foreign key classes

Issue #37
 - Split the foreign key class into three separate classes
Merge pull request #44 from magnetfruit/issue37

Foreign key classes