First step in implementing truncate

The mapheader is now kept in memory.
Mapheader now contains a signature and a version.
Bugfixes
Improvements
Removed code duplication in truncate operations
Improvements