Add support for automatic generation of factories with GenerateT4FactoryWithContractAttribute.

Avoid generating a factory interface if an existing one is found not marked with GeneratedCodeAttribute.