Make progress code extandable

* move the json code generation to a separate method,
* add a "slug" parameter to the roles,
* make the javscript use "this" instead of closures.

Change-Id: I8fab855b0e9d54e3b02fca54303b84b6e5197e68
Merge "Make progress code extandable"