Re-factored workflow graphing code into a proper-ish JS class