refactoring and more unit tests to Tmx.Server