Fixes race condition in resources

This is accomplished by changing group_id, an integer field,
to res_group, a foreign key to a new model called ResourceGroup.
Fixes migration for resource groups
Calling .save() is important
Adds backwards migration and cleans up missed change
Add comment that group_id is deprecated
Addressing comments on resource group change
Fixes typo with extra parens
Merge pull request #1380 from learning-unlimited/resources-race-condition

Fixes race condition in resources