Refactor, implement drawtiles and tilelayer