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>