Calculator: add support for ln and (mostly) arbitrary base logs

We're only actualy doing logs up to base 999.. but I think
anything else is probably people goofing. I can be convinced otherwise,
though.

I have a feeling that matching change will come back to bite me, but
looking for cases has proved fruitless thus far.