Reorganization of tile/map code.