A Categorical Representation Language and Computational System for Knowledge-Based Planning