Implement writing of chunked shares (used in tests). refs #1959

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>