Re-publishing operational

If a program has been published then re-publishing updates its widgets
leaving the text in place.

Also re-factored the code on published pages for easy of updating.