Add Functor classes for exact solutions

This allows us to have exact solutions which depend on problem
parameters without having to use global variables.