Refactored LobattoFunction to be templated on Scalar type.