Change diagram callbacks to event-based implementation.

Getting a graph now emits a 'change' event. This simplifies the code and removes requirement for global variables.
Unify API endpoints to use common 'update' name.
Make global duration setting and make configurable.
Abstract svg icons into partial.
Move App starting routine out of partial and into library.