Fixed bug with constructing list of all referenced fields.
Fixed bug with constructing list of all referenced fields.

Placed scripting code into main() function, which makes it easier to do
line-by-line profiling with, e.g., kernprof.py.

aashish24/tangelo,ecohealthalliance/tangelo,aashish24/tangelo,aashish24/tangelo,ecohealthalliance/tangelo,Kitware/tangelo,Kitware/tangelo,mathstuf/tangelo,ecohealthalliance/tangelo,mathstuf/tangelo,mathstuf/tangelo,Kitware/tangelo