Document object proto and implementation