Use A_mul_B!, etc. for overwriting multiplications.

Also modified some of the optimization calls.