[WIP] #1407 Remove resourcegroups.

Started of the work to remove resourcegroups entirely.

Contains a migration to have resource link directly to package and migrate the data out of resourcegroup.  It simplifies all of the queries where resourcegroup was previous used (no more joins) and removes it from the relevant schema.

Still requires more testing as there's a lot of red and no so much green in the diff ;)