cache for Formula.to_term;
profiling hooks in several places