Not clickable buttons are now disabled.
Changed some things in the json model.

A factory is used to create actions and objects.
Added some utility functions.
Changed the generated JSON to fit with the viewer.

The viewer will be refactored, and this patch is supposed to fit with
this refactoring.