Changes and improvements to to_matrix, to_row_vector, to_array_1d, to_array_2d, to_vector. flatten renamed to array_1d.