store read data in an array instead of echoing

modified getDataOut method to create array and populate, instead of
merely echoing retrieved data, so we can transform to XML, JSON, etc.