A common evolutionary origin of two elementary enzyme folds