libcommon|MapStateWriter|MapStateReader: Moved more logic into MapStateWriter/Reader