added pair chunks, added double scanning

Implemented I/O chunks for processing pairs of chunks. The primary usage is to
provide an error string if the first chunk is null. Added a scanning funcion
for reading doubles.