Factor out and expose usecapture logic.
Add API for looking up a lexical in a given frame.