Cache previous formula tokens to avoid formula re-compilations.

Change-Id: If20e0ebf5410af0b7655f36f7e4fc06f53d8b14b