Fixed intersect bug so that bed query with Bam DB correctly gives bed ou...

...tput. Added unit test.