The Functional Characterization and Crystal Structure of the Bifunctional Thioesterase Catalyzing Epimerization and Cyclization