Separate implementation of ScalarCovarianceFunction

Fixes an item in #47.