CA-107919: Reduce memory usage when writing large RRDs.

Previously we temporarily allocated an enormous data structure in
memory with partially applied functions all over the place. Now
we don't.

This commit also adds a couple of test programs and some helper
functions to Rrd (of_file and to_file) and removes some dead code.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Merge pull request #1 from jonludlam/CA-107919

CA-107919: Reduce memory usage when writing large RRDs.