fix bug with JSON output;
integrated new BAM reader