cylc poll: fix submit-fail handling
cylc poll: modify new test to allow submit-fail
Merge pull request #1192 from benfitzpatrick/fix-poll-submit-fail

cylc poll: fix submission failed handling
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
Refactor task proxy

Remove task proxy class generation logic. Move `cylc.task_types.task` module to
`cylc.task_proxy` and rename the `task` class as `TaskProxy`. Each task proxy
is no longer its own class, but they all belong to the `TaskProxy` class.

Allow `-`, `+`, `%`, and `@` characters as task names.

Simplify logic in various places.

Reduce memory footprint.

More pep8 and pylint fixes.