(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.