Separate implementation of all classes ScalarFunction.h

Ticks an item off the list in #48 because reasons.