(PDB-865) PDB 2.2 migration fails when nodes have no facts

This patch handles an error that occurs if a user attempts the 2.2 upgrade
with nodes that have no associated facts in the database, and adds some
additional testing around the migration.
Merge pull request #1083 from wkalt/ticket/stable/pdb-865-bad-data-migration-fix

(PDB-865) PDB 2.2 migration fails when nodes have no facts