         (.add attrs (ItemAttribute. (keystr k) (keystr v) true))))
     attrs))
 
-(defn- parse-attr-list [attrs]
+(defn- parse-attr-list
+  "Given a List of ItemAttribute objects, return a map of name=>value
+  and/or name=>[values]"
+  [attrs]
   (reduce (fn [m attr]
             (let [k (.getName attr), v (.getValue attr)]
               (assoc m k

    (.putAttributes item (make-attr-list keyvals))))

(defn get-attrs
  "Returns attributes (a map of key=>item or key=>collection) in the
  item under the domain."
  ([item] (parse-attr-list (.getAttributes item)))
  ([domain-name item-name]
     (let [item (get-item domain-name item-name)]
       (parse-attr-list (.getAttributes item)))))

(defn delete-item [domain-name item-name]
  (.deleteItem (get-domain domain-name) (keystr item-name)))

(defn list-items
  ([domain-name]
     (.getItemList (.listItems (get-domain domain-name))))
  ([domain-name query-string]

(defn- keystr [x]
  (if (keyword? x) (name x) (str x)))

(defn- make-attr-list
  "Given a map of key=>value or key=>[values], return a List of
  ItemAttribute objects."
  [keyvals]
  (let [attrs (ArrayList.)]
    (doseq [[k v] keyvals]
      (if (coll? v)
