Fix IsPowerOfTwo
Add tests for common math functions