Move MapBlock (de)serializing code out of Database class