Refactored dimension calculations

- Get dimensions through distinct instead of reduce(max), similar
runtime on large scale data, and lets us calculate bounds as well as
number of unique values
- Dimension class for storing max, min, and num of unique keys
- Save uses number of unique keys to reshape, allowing for
non-contiguous indices
Implemented saving streaming data to text
Refactored sub to ind conversions with an inline function
Renamed modified model to LinearRegressionModelWithStats to avoid conflict with MLlib