Working on general method for getting "dummy vars"

This allows us to generalize the model, and easily fit the model
to the data using least squares for any number of factors and
factor values.
Clean up tests