Generative models for codon prediction and optimization