Moving tiles.js to its owen file, formatting