Core functionality for a Java implementation of Tetris