Huge rework to the backend

Now tile prototypes that the map references. Instead of the map holding
X by Y tiles it now holds X by Y references to a prototype tile.