Only do one map lookup instead of two.

Affected functions were:
* Factory::create()
* Factory::crate_shared_ptr()
* Factory::getValidParams()
* Factory::deprecatedMessage()

Why are you always looking stuff up? Just go!

Closes #3642.