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

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