Optimized bitwise_distance.c

bitwise.dist should now run roughly twice as fast as before.