Bugfixes to the previous commit and adding comments etc.
Changes to the upgrade script so that 'IN' and 'NOT IN' are not used in the queries and hence the upgrade script is much faster.
Adding new files for upgrading version 1.5 database to version 1.6 database