Updated create tree. Vectorized packbits is used.
Updated generate_masks. Vectorized packbits are used.