fixes and refactoring to Tmx.Server/Tmx.Client