JS implementation of Tetris using HTML canvas