Simplify declaration/TODO counting

It's now done during emitting instead of via extra AST walking functions.

This way it can easily be more accurate (e.g. the old astCountUnknowns()
missed TODOs inside #define bodies), and it's faster and uses less code...