Removed ScriptNode.h include from GafferImage/Format.h

Format _should_ be a simple math class with no knowledge of Nodes or Plugs whatsoever. But until we get that fixed we can at least use a forward declaration to stop it forcing a rebuild of the whole of GafferImage when the ScriptNode header changes.
Fixed circular references within undo system.

These resulted in ScriptNodes never dying, because the Action items in the undo queue held references back to the ScriptNode itself. Because the ScriptNodes weren't dying at shutdown, interactive renders weren't being ended during shutdown either, causing crashes as the background rendering threads tried to continue while everything disappeared around them.

Fixes #397, replacing it with a nice reliable deadlock (#855). Progress!
Removed unnecessary IntrusivePtr usage from Action::enact().

We need to tighten up on this in general, and only use IntrusivePtr where ownership is required.
Fixed PyQt circular references within GafferUI.Menu.

With PySide there appears to be no problem at all with the existing menu code, but PyQt was keeping the slots connected to the menu actions alive forever, even following garbage collection. Since the slots had references to arbitrary curried commands in them, this could actually leak significantly. For instance, the File->OpenRecent menu items contain references to the current script, and this PyQt bug meant that the ScriptNode would never be destroyed. This has dire consequences for proper application shutdown.

It seems that we _can_ trust PyQt to properly manage the lifetime of the QMenu and QAction objects we create, so rather than curry things into the slots called by signals, we now store the menu definitions on the QMenus themselves, and the menu item definitions on the QActions themselves. This also allows us to reduce the number of arguments to __build and __actionTriggered (formerly __commandWrapper).

Fixes #397 for real - previously it was fixed for PySide builds but not it is fixed for PyQt as well.
Added check for zombie ScriptNodes in gui app shutdown.

If I have to go down that rabbit hole again, it'd be nice to have a torch this time.
Removed rogue ScriptNode constructors from UI components

These didn't actually trigger the warning just added to gui shutdown, because the node was deleted immediately upon construction, but there certainly was absolutely no need whatsoever to go creating a new object just to call a static method on it.
Fixed crash caused by File->Quit menu item.
Fixed Viewer shutdown error.

Now we have the lifetime of the ScriptNode sorted out properly, the Viewer was emitted the following message on quit every time :

`ReferenceError: Instance referenced by WeakMethod __updateRequest() no longer exists`

This turned out to be because there was a View->Toolbar->View circular reference keeping the View alive past the lifetime of the Viewer. Thus the Viewer was requesting updates but the Viewer wasn't there to service them. Removing the circular reference fixes the problem.
Merge pull request #856 from johnhaddon/scriptNodeLifetime

Script node lifetime fix