[DDMD] [refactor] Move Expression::optimize into a visitor class

This is a big one, but I left a forwarding function in expression.h so we don't have to change all the uses to call the free function.