Fixed some functions. Added test cases.

There are 135 test cases. All pass. Made log more explicit, there is no
ln, log2 and log10.