DnD logic changes, query ontology changes, some code clean up