Add integer log2 and utilities for dealing with powers of 2
Fix bug in log2_ceil; add div_ceil