CS and documentation fixes

Updated docs to support IDE autocompletion and hinting. Re-ordered "use" statements, and removed unnecessary ones. Fixed some class references (e.g. "InvalidArgumentException" becomes "\InvalidArgumentException").
Remove unused args/code in UnitOfWork::doMerge()
Refactor if/else in DocumentRepository::find()