implemented get_docs, which does most of the work

this will get docs, track state, and cleanly exit

totally untested