added draw function and refactored map so each cell is a table containing a tiletype (number) and an image