complete and optimize a bit
remove some debug and cleanup
fix small issue in tileset generator