tileset: Rename TileCount to LastID and add the IsValid method to TileID.