Fixed issue128 merge bug

A complicated merge has accidentally caused a few bugs in the following
areas:

- Group assignment
- Fixed file hashes
- Policies directory dropdown

This commit resolves those problems.
Added ajax based paging
Added SWID tag view and template
Moved get_software_ids method to tag model
Changed table header rows to th
Removed old tag and regid views
Added new auth app with useful mixins
Enforce permissions in SWID views

User should be logged in to view permissions.
Added test to verify the login permissions
Added view inventory button to device and session views
Renamed SWID urls
Re-added SwidInventory view

The SwidInventory view was accidentally removed during a big merge.
This commit adds it back.
Small test_ajax.py refactorings

- Renamed models to tnc_models and new_models to swid_models
- Reordered fixtures
- Added section comments
Refactored out ajax_request function

- There is now a helper function to do an AJAX request.
Added test for `tags_for_session` ajax endpoint
Refactored tags_for_session
Moved get_installed_tags_with_time to tag model

As that function returns tag instances, it's probably better to bundle
it with the Tag model.

See also: https://redbeacon.github.io/2014/01/28/Fat-Models-a-Django-Code-Organization-Strategy/
Refactored get_installed_tags_with_time

Among other things, this does a database prefetch optimization in
get_installed_tags_with_time

Originally, the function first did two SQL queries to fetch the device
associated with the current session and the sessions associated with
that device, and then created a new query for each session up until
today (to fetch the related tags). This caused a complexity of `O(n +
2)`, where n is the number of sessions <= today.

By using the `prefetch_related('tag_set')` method, the ORM first does a
single query where all related tags are queried. The result is then
joined in Python, reducing the complexity to `O(3)`.

Things like these can be debugged easily when the `django_extensions`
package is installed:

    python manage.py shell_plus --print-sql
Exchanged old paging with AJAX paging