Mechanisms of flavin catalysis