Fixed generation of MD and NM tags in cram_decode_seq() when using a
non-reference encoding. These cannot be stored or regenerated in such cases.

(Question: should we therefore explicitly store any MD and NM tags
when generating the CRAM if using non-reference encoding? Probably yes.)
Added a special case for setting the reference.  When converting from
SAM to CRAM we tend to think of the reference as an input property; if
it is not in the SAM headers (M5 & UR @SQ tags) then we want to
specify it, as an input property.

However the way the code works is we parse the input header and use
that to generate the output header, in doing so setting the reference
to use for the output.  Hence technically the reference is an output
variable (as in this example in=SAM and out=CRAM).

To make things sane for the user, if we set the reference for the
input then we also now apply that option to the output file too.