Nice work!. I forked it and fixed BitCount, not sure why it didn't work in actionscript, probably because all arithmetic is done in floating point.
I think there's also a bug in dpbj.cpp with the set instruction (pbjLoadConstant) when reading the register mask, but I haven't really looked into it.