Automated Code Engine for Tensor HyperContraction: Derivation, Optimization and Implementation of Rank-reduced Coupled Cluster Theories