Indexing large application runs out of memory

Steps to reproduce:

dxr-build.py with very large application (120,000+ objects)

Actual results:

Received "out of memory" message from system during the "Generating callgraph" step and process was apparently killed by the kernel (?).  On a retry we observed the process was using almost all of the 21gb swap space on the system after getting to the callgraph step.

After instrumenting the build script the problem seems to occur in the fetchall functions and fetchall variables steps, which makes sense.

Expected results:

Process should have completed eventually over the weekend.
cleaned up chunking by Jack Marr into a generator
Made doc string more descriptive
removed extra p that broke tests
fixed to comply with pep8 and dxr standards
Cut memory use when generating inheritance tree and call graph. Fixes bug #1004547. Close #279.