Re #8634. Add caching of names in FunctionFactory::getFunctionNames.

This method was fairly expensive because it had to create an instance of
every registered function every time to find out if it's the requested
type. This method is called to create validators in various algorithm
init methods, which can be called a lot it - for example - the algorithm
is used as a sub-algorithm in a loop within another algorithm.

It's now cached in a map that's a member of FunctionFactoryImpl. The caching
had to be made thread-safe with a mutex. On the plus side this allows the
resulting vector to be returned by reference-to-const.
Re #8634. Add some kind of testing for getFunctionNames.
Merge branch 'feature/8634_functionfactory_getfunctionnames_caching' into develop