Keep allocation and error checking together
Index BAM/CRAM files if that hasn't already been done
Trim bounds in a BED file so that don't overflow the actual contig lengths
Fix a few errors in bed.c that broke things
Merge pull request #3 from dpryan79/devon-development

Merge in a number of fixes from my devel branch. In particular, a few bugs are fixed in BED handling and an attempt is made to index bam/cram files if that wasn't already done.