continued big refactor and enhancements

this has now been manually tested with the stopwatch example and works
when running locally with and without purity however the darteditor
build seems to be broken so I can't test running as a client server app
yet.