When clearing ViewerPanel, first call clearGroups(), then clearSources()
When clearing ViewerPanel, first call clearGroups(), then clearSources()

Otherwise, the SourceGroupTree may still be painting the update that
removed sources from groups, when clearGroups() removes these groups,
leading to IndexOutOfBoundsException.

This is a workaround rather than a solution. At the moment, nothing
prevents modification of the SynchronizedViewerState while the tree is
repainting.

bogovicj/bigdataviewer-core,bigdataviewer/bigdataviewer-core,bigdataviewer/bigdataviewer-core,bogovicj/bigdataviewer-core