add 2d mapping functions to utils
separate text mode and gui mode, and implement all but rendered for gui