Added a CRAM_OPT_REQUIRED_FIELDS option to cram decoding. This is used
in scram_flagstats to required just the necessary fields and as a
result on the newer CRAM files (with more external blocks) it is
approx 3x faster.

Note achieving this is complicated:
- Extra checks around all codec[...]->decode calls to see if this item
  is a needed data-series.

- We need to know which data series are dependent on other data series
  in the code. Eg CF determines whether to decode NF.

- We need to know which data series are dependent on each other due to
  their in-file structure. If we need BF but both BF and TL have been
  HUFFMAN coded to the core block then we also need to decode TL in
  order to get BF correct.

- The mapping of SAM fields to CRAM data series is non trivial. CIGAR,
  TLEN and SEQ are particularly challenging.


In order to test this there are #if-ed out parts of the code, marked
with //RANDOMISER, that make scramble use random external block IDs
and random codecs (huffman vs external) when writing a CRAM. This
stress tests lots of combinations of dependencies.

I also added a scram_test program which via a -c <int> option
specifies a bit field of SAM columns to decode (see cram_structs.h).
I have tested this on a 3Gb file encoded using 3 different coding
methods (original mostly-core, new mostly-external and the randomiser)
and verbatim testing of all single columns via md5sum.


git-svn-id: svn://svn.code.sf.net/p/staden/code/io_lib@3624 ba6f2710-ca9f-427c-89d3-5bf716dbc8e1