Determining a better way to optimize AST.
Cleaning up code.
Working optimizer.