Refactored tetris functions
Fixed namespace for tetris functions, minor refactoring of i/o functions