[WIP] make ASTs cachable

pass in `cache` into `addFunctionWatch`