Break module/command parsing into a helper.

This allows it to be used elsewhere if needed.

Change-Id: I3cf2c16cf3e1e839fa695cf91509dc3d3065e978
Add the ability to clear the Input and Output.

This is needed to support running multiple commands per request.

Change-Id: I90d3f2c4b47308530b561eee29c358b57cb9aad0
Add the start of a module that handles multiple commands.

This will allow the front-end to request multiple things over a
single http request, which ought to be more efficient & allow for
separation of some backend commands which currently violate separations,
but exist to achieve a similar effect in a specialised manner.

This is somewhat experimental at the moment. While it is functional
(and tested for the simple case of independent passing sub-commands)
it is missing any decent error handling, and the sequential command
is untested.

Change-Id: Iad66e7f0704493fbdcbb6d6288d73019fa530819
Move setting of the real outputs to a helper.

This allows it to be used in both the commands.

Change-Id: Ib35f0798b2f4f69ec665f1bf5a7c5f5167f6a49b
Add doc comment to explain how to forumate the commands.

While this is an internal method, it is used by both dispatch endpoints,
so the format is the same. Putting the docs here saves repeating them.

Change-Id: If7eab1cd930e17f67a89e365eb7cc2f6811f2372
Remove redunant over-specification of assertions.

This makes them easier to copy/paste, as well as modify if needed.

Change-Id: Ia92074f27d119cad4dee331b014db85f1ef65ab6
Convert repeat logic to helper.

There are about to be a whole lot more of these checks, so reducing
the repetition in advance is better.

Change-Id: Iab42e09b758ada14ac721f3be15fdd4393df137d
Defer to the ModuleManager for command dispatch.

This removes the duplicate dispatch code from this module, as well
as a bunch of now redundant return statements (the dispatch throws
if it fails, rather than returning false) whose output was ignored
anyway.

Change-Id: I891897fb522dd3e56b88cb25039b392e9b50f974
Also have the sequential enpoint set outputs.

Change-Id: Ib6b4751dad381b2f957fd70ace9eea244f4b8b0c
Only set inputs if there are any.

Change-Id: I4062bc57d4dc1ea9797872fe8a84655c6840a4d2