Tetris clone in JavaScript