introduce docManager classe(closes #2785)

adapt test tu use getDocument instead of new_doc
rewrite new_doc
rewrite createDoc
use DocManager in main action and classes