Characterizing and Engineering Thioesterases as Biocatalysts for Macrocyclization