Move Expression::apply into a visitor class
Move lambdaInlineCost to use the apply visitor
Move lambdaSetParent and lambdaCheckForNestedRef to use the apply visitor
Move hasSideEffect to use the apply visitor