Moved Genelist writing code out

Temporary solution of genelist writing code (should be JavaScript once
done).