Add and complete LogicalOptimizer2 mostly, and but it is still buggy.