Added tenant_id in verification of instanceexists and instanceusages

The highlights of the changes are:

- added tenant_id to verification logic for instanceexists and instanceusage
- added migrations to add tenant to instanceexists and instanceusage tables
- added scripts to populate tenant in instanceexists and instanceusage tables from rawdata
- refactored some tests(extracted reusable methods)