Improved handling of values during map creation

    * Instead of loading all key-values into memory, values are loaded
      only while writing to map file.

    * Tests added for duplicate key handling and sorted keys in block.