Finish first draft of staticAnalysis.

Compiles but is untested.