optimizer: move the equal? => eq? transformation to the optimizer phase

For some types, (equal? x y) is transformed into (eq? x y) in the resolve phase.
This commit moves this transformation to the optimizer phase. This improves
 constant folding and enable some optimizations that are prevented
because equal? can run arbitrary code.

Also, transform   (eq? #f x) => (not x)   and   (eq? '() x) => (null? x)   to use
the type information of x when it's known.
Keep copy of equal? => eq? optimization in resolve (Squash)
Add make_application_2 (Squash)

(This is only used twice.)