Added lots of (untested) stuff to document-server