(defn assoc-conj
"Associate a key with a value in a map. If the key already exists in the map,
a vector of values is associated with the key."
[map key val]
(assoc map key
(if-let [cur (get map key)]
(if (vector? cur)
(conj cur val)
[cur val])
val)))