Implement AST query analyzer.
Work in progress
More work in progress.
Even more work.