Added Path._emitPathChanged() protected method.

This can be used by derived classes to emit the pathChangedSignal(), avoiding emitting it if nothing is listening. All subclasses should use this in preference to self.pathChangedSignal()( self ).
Optimised ScenePath with lazy signalling.

Prior to this, every ScenePath instance was connecting to plugDirtiedSignal() on construction and then when the plug was dirtied, was forcing the creation of the pathChangedSignal() on the base class. It now never forces the creation of pathChangedSignal(), using the new _emitPathChanged() method on the base class. More importantly though, it now only connects to plugDirtiedSignal() when the pathChangedSignal() is accessed for the first time - this removes a huge amount of signal processing in the SceneHierarchy, because there a great many paths are made (one for each level of the hierarchy), but only the root path's signals are accessed.

This fixes the laggy node dragging seen after expanding the SceneHierarchy contents and moving the current frame a few times.

Fixes #209.
Added test checking substitutions on StringPlug default values.
Added Context::hasSubstitutions() method.

This can be used to query if a string contains any substitutions supported by Context::substitute().
Optimised StringPlug::getValue() and StringPlug::hash().

They now check to see if a string contains substitutions before actually performing the substitution - since most strings don't this results in a nice little speedup because we avoid allocating another string. The reduction in total runtime for the 20 frame animation test is around 9%. A little bit of further testing suggested that we may be able to eke out another 1% or so if we stored the result of hasSubstitutions along with the string in the plug's internal IECore::ObjectPtr value. Since this would require custom datatypes I decided for now that the extra complexity wasn't worth the small return - if we see hasSubstitutions() appearing as a significant factor in profiles then we can reconsider that decision.
Merge pull request #667 from johnhaddon/stringSubstitutionOptimisation

String substitution optimisation.
Implements an optimisation for StringPlugs that uses a faster code path when a string contains no variable references, giving a 9% reduction in runtime for John's animation playback test case.
Merge pull request #666 from johnhaddon/scenePathOptimisation

Scene path optimisation