Two memory allocation related changes

Do not use dynamic memory allocation when returning sets of variables (the memory was never free'ed). Instead, fill a set that is passed in.

Make a similar change to getDualClauses and getAtomics. In the case of getDualClauses, the lists allocated on the stack were of such an excessive in number that I was getting many stack overflows. The change to getAtomics is just for uniformity.