Cofactor Biosynthesis: A Mechanistic Perspective