move most of tile rack code to new TileRacks class