preparation for having client and server in a single process
random map generator refactoring and improvements