Compile Python expressions only once, at grammar load/import time.

I don't really like that this relies on an instance var created during object lifetime, but you were already doing that with `takesTreeInput` so you're enabling my bad behavior.