Added an optimization to beta reduce sometimes

If a lambda is applied exclusively to locally bound variables, it is reduced.
Merged new optimization into head