Refactor ActionFactoryManager API to match style.

Replace getFactories and getInstance with factories() and
instance().

Change-Id: I22293b5d5e023d52becf5a06693b8ab42d60cfe5
Make the servertest easier to extend.

Add a helper function for quickly adding validation tests.

Change-Id: I5194163bc22e64aea100a14f9074695e31ef1c9f
Add registerOpenWith method to the RPC server.

This allows clients to configure output file handlers over RPC.

Change-Id: I22f7c9856235af10fb4410da163870b880079e1e
Add RPC open-with handlers.

ProgrammableOpenWithActionFactory is merged into its subclass
OpenWithActionFactory, and extended to support RPC calls.

This change will reset old action factory settings.

Change-Id: Ie9b43df5c9f88aaa9c1df7e245114cb593863cb9
Add client API for interacting with open-with handlers.

Also call flush() from the JsonRpcClient's destructor,
otherwise messages aren't always sent before clients are
destroyed.

Change-Id: I4261c6fc780ab11c4d0a3faf8ebe91efba9b845a
Merge topic 'rpc-open-with' into master

e026963b Add client API for interacting with open-with handlers.
ff6ab70e Add RPC open-with handlers.
9d86eadb Add registerOpenWith method to the RPC server.
7c81d648 Make the servertest easier to extend.
70a99828 Refactor ActionFactoryManager API to match style.