add factory BAM input factory class in Makefile.am
add check for BAM output factory and output block callbacks
add missing include statement
fix writeBamBlock method