Addressed issue with conversion operator from StorageRef<storage_type> to nonconst_storage_type. StorageRef constructor calling this operator was getting constructed with invalid iterators that moreover pointed to a copy of the data instead of original data. Also changed Tensor and TensorView template constructors to no longer require convertability of StorageRef to nonconst_storage_type.
Simplified methods in tensor_func.h by introducing templated type TensorViewOf<_T>.
Added diag(RangeNd) method which constructs a new RangeNd stepping only through the diagonal indices of the original range. (Diagonal indices are where all entries are equal.)
Added diag(T) method which constructs a diagonal TensorView of a Tensor (or another TensorView). Also added test_tensorfunc.C to test folder.
Minor readability improvement.
Created range functions group(r,istart,iend) and flatten(r) which group a set of adjacent indices (or all indices in the case of flatten) into a single index. Added related TensorView methods to tensor_func.h.
Merge pull request #30 from emstoudenmire/master

Fixed major StorageRef bug. Created diag, group, and flatten Range/TensorView slicing methods.