Allow operator name to differ from function name.

Also refactored a bit.