Add context option to dom.read and dom.write API (closes #1)