Don't save unnecessary items in the dictionary when exporting old RMG-Java database.
Don't save unnecessary items in the dictionary when exporting old RMG-Java database.

The database entries list in RMG-Py contains the reverse template, and potentially 
other unused nodes. These can cause problems when trying to read the dictionary in to RMG-Java.
See @GreenGroup/RMG-database#22. 

This commit makes it so anything that is not referred to in the tree, is commented out
when you save the database. The difficulty is that some nodes are not explicitly mentioned
in the tree, but are needed to fully define some logic node that IS in the tree.
It ends up a little complicated recursing through these cases, but it seems to work.

Closes @GreenGroup/RMG-database#22.

nickvandewiele/RMG-Py,comocheng/RMG-Py,chatelak/RMG-Py,comocheng/RMG-Py,enochd/RMG-Py,faribas/RMG-Py,enochd/RMG-Py,pierrelb/RMG-Py,faribas/RMG-Py,chatelak/RMG-Py,nyee/RMG-Py,nyee/RMG-Py,KEHANG/RMG-Py,pierrelb/RMG-Py,nickvandewiele/RMG-Py,KEHANG/RMG-Py