Initial commit of Generic_factory class code