fix up env path/scope chaining to not mutate
add FlowAs matcher