I implemented rotating the active piece by pressing the up arrow.
It works as intended. I also implemented the piece moving away from the sides if there's not enough space for the rotation.
The problem comes in, when you rotate it into another piece, or the ground.
Momentarily, this case results in an endless loop due to the handling in InputManager.js line 49ff.
A way to differ between out of bounds to the sides and these two unhandled cases is needed.