Simplify calc.py; add trig/other functions

@sarina @nedbat