Refactored to use templates, and allows scalars to be and written to and from std::vectors
Refactored to use templates, and allows scalars to be and written to and from std::vectors