Add DB level foreign keys. Closes #19