Fix differences between db, and access bug for inventory
Fix differences between db, and access bug for inventory

As development on the inventory rewrite focused on testing for the
development server, using sqlite, and then later on postgres, some
differences in assumed object type broke parts of the InventoryListView.

These problems have been fixed by changing the InventoryListView's model
to Machine, which it probably should have been before. All references to
the machine property of the instance were then updated to simply refer
to the instance.

The GroupMixin was updated to handle filtering based on the new model.

This allowed for the removal of the postgres vs. sqlite clause in favor
of just using the supported `distinct` (with no arguments) method.

All helper methods of InventoryListView were updated to also reference
instance directly, rather than `instance.machine`.

The other piece of this commit is fixing incorrect access to items
outside of the requested BusinessUnit, MachineGroup, or Machine in the
ApplicationDetailView. Differences in the sqlite vs. postgres code
had the view showing all versions and all paths present in the database,
even if they shouldn't have been available based on the access filters.
This has been fixed.

sheagcraig/sal,erikng/sal,erikng/sal,erikng/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,erikng/sal,salopensource/sal,salopensource/sal,sheagcraig/sal,salopensource/sal