Turing Machine in Javascript