Py2.6 doesn't have int.bit_length--use bitlog2