Add Document#output_ext
Ensure `@data` is set when setting the default proc
Extract things to Document as much as possible