some improvements to documentjs to make it work better for applications