Free-fermion descriptions of parafermion chains and string-net models