added ArrayWriter, stripped down array writer in case recfile or esutil are not available