code: function mapify(elements) {
      var result = {};
      for (var i = 0; i+1 < elements.length;) {
          result[elements[i++]] = elements[i++];
      }
      return result;
  }
docs: Converts the list of keys and values that comprise an AMQP encoded
  map into a proper javascript map/object.