Converts existing data to new structure in database as part of
upgrade, including a progress bar.
Deletes the database tables and fields that were used by the old
system and are no longer needed.
Suggested by Petr:
* Don't rely on single user for upgrade
* Make the pathnamehash generation a bit clearer (and add
a test to verify its correctly formed).
* Upgrade function to remove duplicates from the grade item duplicates
column. Duplicates were causing sorting to fail in some cases.
* Add some unit tests which simulate sort order duplicate data and
verify that they have been removed.