The resolveValue and resolveReference functions are copy-pasted almost verbatim across engine.ts and evaluators.ts. Furthermore, evaluators.ts introduces resolveReferenceAny which duplicates the exact same resolution traversal logic. This should be centralized.