Fix bug with collection adds, refactor foreign key on persistence package