Foundational, Compositional (Co)datatypes for Higher-Order Logic: Category Theory Applied to Theorem Proving