Fleshed out doc.replaceItemValue a bit (issue #2)