Add functional class approach.

Add a (half-serious) functional solution to stringcalc.