Made Class parameter for DefaultedKeyFactory allow any Class type.

This is needed to support constructing factories for generic types.

Signed-off-by: Irmo van den Berge <bergerkiller@gmail.com>
Merge pull request #2246 from bergerkiller/master

Made DefaultedKeyFactory support all Class types