PbsCmdLineTask: add context manager to log flow in/out

This takes care of the common "starting", "finishing" log messages,
and optionally swallows exceptions, optionally logging tracebacks.
Merge branch 'tickets/DM-662'
genericize PBS operations for use with slurm

The tiger cluster will soon only support slurm.
Moved generic batch system code into a base class,
and added PBS, Slurm and SMP specialisations.  It
would be simple to add another specialisation for
Condor.

There have been several renames (e.g., PbsPoolTask -->
BatchPoolTask, PbsCmdLineTask --> BatchCmdLineTask),
reflecting the new, generic code.  The APIs have changed
slightly too, so the name changes should make it easy
to identify non-conformant uses.
pool: remove barrier in broadcast

The barrier is not necessary, as all operations are already
blocking.  It only slows us down.

See http://stackoverflow.com/questions/13305814/when-do-i-need-to-use-mpi-barrier
parallel: add command-line option for python profiling

Adding "--batch-profile" triggers cProfile to output a
profile (readable with pstats) for each process.
Merge branch 'tickets/DM-741'
SConstruct: remove Mercurial
parallel: allow for case that args.job is None

args.job may be None if it's not set on the command-line.
parallel: fix --do-exec

Previously revised a variable name without updating it everywhere
it's used.