Classic snake game written in javascript