Added foreign keys
Closes #19