Added support to serialize dialogs.
Added type for 'hierarchy' variable.