Revert "Revert "refactors buildings IO file one again, to handle sockets properly""
apparently not... lets stick to this :D

This reverts commit a1995919fc736a4f16c2d0d957d83e5e69c41faa.