Store all variant headers and also combine them for an overall header
1. Modified operator == in IndividualFieldValue to use iterators which
take care of bcf_*_vector_end values implicitly
A more serious bug in the previous implementation of the == operator was
in the way string fields were handled. Points to remember for string
fields:
a. The size() function returns the number of characters allocated for the string.
b. The variable m_num_bytes also stores the number of characters
allocated for the string (same as size())
c. When operator[i] is called for string fields, the address that is
accessed is m_format_ptr->p + i*m_num_bytes (not m_format_ptr->p + i).
The address accessed is outside the original allocated memory.

Moral of the story: use iterators always, or remember the intricacies of
string v/s other types of fields.

Similar fix for SharedField also

2. Use references to avoid copies where possible as per David's
suggestions
3. Specialized operator[] for IndividualFieldValue<string> and
SharedField<string> so that if the original VCF field type is of type
String, the index argument for operator [] cannot be greater than 0. If
it is greater than 0, then an out_of_range exception is thrown.

3. Added extra out of bounds test cases (by catching exceptions)

4. Fixed a memory leak in file_utils.h
Merge pull request #301 from broadinstitute/jt_mvr_fixes

Store all variant headers and also combine them for an overall header
VariantBuilder
VariantBuilder code review round 2 update

-Addressed round 1 code review comments

-Enable move semantics when setting individual fields
 (allows for zero-copy bulk setting of a field for
 all samples at once)

-As a side effect of the above, setting individual fields
 by sample instead of in bulk is now supported. Uses
 short-value optimization to keep the per-sample values
 as contiguous as possible, but this option is still less
 efficient than setting in bulk.

-Significant refactoring to support the new move semantics
 and per-sample field setting:

    -split VariantBuilderDataField into VariantBuilderSharedField
     and VariantBuilderIndividualField

    -individual fields are now encoded at build time instead of
     at field set time; shared fields are still encoded upfront

    -to allow setting individual fields by nested vectors and
     by sample to compete with setting it by flattened vector,
     had to write a lot of low-level encoding routines to replace
     the former strategy of converting to flattened vector then
     handing off to htslib

Remaining TODOs:

-Fix issues with float missing/end of vector values (these are
 proving very problematic)

-Build-by-merge support (Joel indicated that this would be helpful
 for his use case, after all)

-More tests (now that Coveralls is working again, I can see the
 coverage gaps clearly)

-Doxygen comments / documentation
Fix bug with float missing / end of vector values

Apparently we can't use the htslib bcf_float_missing and bcf_float_vector_end
values directly -- need to copy them into local variables before use.
Fix bug in validation of vector lengths when setting individual fields

Previous validation routine would incorrectly allow nested vectors
whose first dimension was greater than but divisible by the number of
samples. Now validation of vector<vector> is separated from validation
of flattened vectors.
Improve test coverage, and fix issues found by new tests
MultipleVariantReader changes causes the test case for Issue #209 to pass
- but the issue still exists, so add a new test case
ReferenceBlockSplittingVariantIterator
- uses htslib hack to modify Variant (TODO: use VariantBuilder)
- TODO: test ref bases
Fixed signed-unsigned comparisons
1. Modified ReferenceBlockSplittingVariantIterator to insert 'N' as the
reference allele for a split <NON_REF> GVCF interval. This is done by
introducing a function set_reference_allele() in Variant.
2. Uncommented the test cases for
ReferenceBlockSplittingVariantIteratorr reference allele
3. The problem*.vcf files failed because their headers did not declare
an END field. htslib assumes that fields which are not declared are of
type String. Declaring END as an integer field in these files solves the
problem.