Simple js function that encodes DNA sequence