small fixes to bam.lua
simplified table_gen()
fixed issue where non-existing chars would not end up as 0
added unittest for entire octet1
separated test and valgrind in build-script