Partial refactor to allow nested vectors and arrays

// TODO: Refactor these export functions into an external class.
//
This will allow the class to be reused for the sub-elements
//       of
the vector.