use metaclass programming to fix the bitarray factory
use fromfile for bin file