Added foreign keys
Rewrote models to include foreign keys and necessary validations. Tests pass.