Move all algorithms about tiles into tiles.js file and make index.js use it
WIP on save data per tile. Rendering looks like the boundingBox calculation is not really working :/