Added documentation to heuristics and polyglot

Also took the running of the analysis out of the constructor and made
the classes new-style classes