Modified binary format for maps. Now writing as interleaved key-values instead of two lists (for less copying)