Initial implementation.
Fix shutdown hang and add to test battery.
Assign correct db as "primary"
Merge remote branch 'upstream/master' into cylc6.viewable-db
cylc scan: scan multiple hosts

Scan all monitored hosts by default.
Merge remote branch 'upstream/master' into cylc6.viewable-db
Back compat.
cylc restart: fix 'runahead' state handling
Merge pull request #1193 from benfitzpatrick/restart-runahead

cylc restart: fix 'runahead' state handling
Merge pull request #1189 from matthewrmshin/cylc-scan-hosts

cylc scan multiple hosts
Handle exception raising.
allow prev point format with prev icp
Merge pull request #1194 from benfitzpatrick/prev-point-format-prev-icp

Allow prev-format `initial cycle point` with prev `cycle point format`
Merge pull request #1173 from arjclark/cylc6.viewable-db

cylc 6 -  second db
Further refactor to the batch systems logic

Decouple the task, job submit and job file modules.

Turn `JobFile` into a singleton. Move `cylc.job_submission.jobfile` module up a
level to become `cylc.job_file`. Use a single dict to pass information to the
`write` method for a much cleaner interface.

Rename `cylc.job_submission` package `cylc.batch_sys_handlers`. (It is no
longer just about job submission, but also other interaction with the batch
systems.)

Batch system handler classes are no longer sub-classes of `JobSubmit`. This
allows their interfaces to be much more flexible.

Rename `JobSubmit` to `BatchSysManager` and turn into a singleton. Manage
instances of batch system handlers (so there is no need to create new
instances unnecessarily). Move most batch systems related logic into this
class. Move `cylc.job_submission.job_submit` module up a level to become
`cylc.batch_sys_manager`.

Allow batch system handler classes to directly format the directives. This
allows each class to have full control of what goes into the job file.

Improve `at` submission command. Use STDIN to write command to `at now`.

Improve `pbs` handler logic. If a directive key contains a space character,
then use the equal sign as the assignment operator. If a directive key does not
contain a space character, use the space character as the assignment character.
Remove the poll output filter logic, as `qstat` already returns non-zero if the
job ID is supplied as an argument and it is no longer in the queue.

10/10 pylint scores for the job file and the batch system handler modules!
Improve logic and doc strings
Update test
Fix docs and comments