Prototype dev

Building upon that first sketch, this is the basic prototype which takes a MatrixFormula and produces an optimized MatrixFormula. There are several new tests, including one ScalaCheck that does a sort of sanity checking for the property that optimizing an optimized MatrixFormula produces the same MatrixFormula.