fixes and refactoring to Tmx and Tmx.Server