New command distdir to distribute directions over subsets

This is used to split a previously generated set of directions as
generated using gendir into subsets, each to be acquired with a
different phase encoding direction. It also optimise these directions to
sample the space of eddy-current distortions as uniformly as possible,
as required by FSL5's EDDY, by flipping the sign of directions.
New command 'splicedir' to merge DW_schemes

This assumes a number of subsets per b-value each corresponding to a
different PE direction, and merges them into one large encoding file
with their order randomly reshuffled. The resulting file is a 5 column
format, with the (normalised) X,Y,Z gradient direction, b-value, and an
index corresponding to the PE direction.
splicedir: output to file (as per doc) rather than std::cout
gendir: use default power of 2 rather than 128

This actually seems to produce more uniform direction sets (as assessed
using SH fits and looking at the power in the l!=0 terms) than using
higher powers, even though higher powers do result in a larger and more
uniform nearest-neighbour angle.
gendir renamed to dirgen

In anticipation of a few more commands to operate on directions, which
will all use the 'dir' prefix
splicedir -> dirsplice and distdir -> dirsplit
updated versions of S2C / C2S converter functions

These are used to convert between cartesian and spherical coordinates
Progressbar: use VT100 code to clear the line

This avoids dangling characters left on the screen when the message text
is shortened for any reason.
Progressbar: update look and minor bug fix
a whole slew of new & updated commands for handling & generating directions files

dirgen: generate directions using electrostatic repulsion (was gendir).
        Now includes option to use unipolar repulsion model.

dirsplit: split direction set into a number of approximately distributed
        subsets (uses brute-force search with random permutations).

dirflip: modify directions sets to make them near-optimal with respect
        to the unipolar model by inversion of directions - has no effect on
        optimality with respect to bipolar model

dirorder: modify order of directions to ensure near-optimality upon
        truncation

dirsplice: combine multi-shell, multi-PE encodings to produce a single
        merged DW encoding for import onto the scanner.

dirstat: report basic statistics about quality of a direction set.
Command-line parsing: allow multiple optional/allow_multiple arguements

Allow the command-line syntax to accept multiple arguments to be specified as
optional and/or allow_multiple. This allows command to accepts a syntax such
as:

    $ process [ inputs ... ] parameters [ outputs ... ]

The restrictions in this case are:

- all optional and/or allow_multiple arguments must have the same flags set
  (you can't have one argument optional, and another allow_multiple).

- the number of actual arguments passed to each specified argument must be the
  same, and correspond to what is left over once all other arguments have been
  accounted for.
Fix minor bug in progressbar display
Fix bug in Math::absmax(), which caused issues for stride handling