Added foreign key constraints thanks to optilude! Closes #32