runtime: Separate out handling of graph commands
runtime: Separate out handling of network commands
tests: Pass a graph identifier

The UI does this, in order to support multiple graphs.
runtime: Move most of component library code into separate file