Make use of new proto pattern in document.js.