Branch commit. Modifed getSampleData to take a buffer. Added calls to allocate and free buffers. Passes unit tests on badger but have not tried on savanna yet.