Added a couple test to TileManager
Added a test and refactored a bit