Add addDocumentsToHyperCorpus function

This commit refactors the codebase to add a new function called
`addDocumentsToHyperCorpus` which generalises the common pattern of
calling `insertMasterDocs` and later adding the documents via the DB
`Doc` functions.

It also "lowers" some functions to run into a plain `DBCmd`.
4 jobs for adinapoli/issue-261 in 37 minutes and 20 seconds (queued for 55 seconds)
Status Job ID Name Coverage
  Stack
passed #8474
stack

00:00:42

 
  Cabal
passed #8475
cabal

00:24:34

 
  Bench
passed #8476
bench

00:03:26

 
  Test
failed #8477
test

00:08:37

 
Name Stage Failure
failed
test Test
Test suite garg-test-tasty: FAIL
Test suite logged to:
/builds/gargantext/haskell-gargantext/dist-newstyle/build/x86_64-linux/ghc-8.10.7/gargantext-0.0.6.9.9.7.6.3/t/garg-test-tasty/test/gargantext-0.0.6.9.9.7.6.3-garg-test-tasty.log
0 of 1 test suites (0 of 1 test cases) passed.
Error: cabal: Tests failed for test:garg-test-tasty from
gargantext-0.0.6.9.9.7.6.3.

Cleaning up file based variables
ERROR: Job failed: exit code 1