Fix global object handling in worker script JS files.

Task-number: QTBUG-36874
Task-number: QTBUG-36881
Change-Id: Iacf4807dd37862e792ad1ba4ce540a6d48f1e495
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Make SmoothedAnimation and SpringAnimation smoothly transition again.

Fix regression introduced in Qt 5.0 when animation backend was
rewritten.

Task-number: QTBUG-36709
Change-Id: Ib8caa4bc6a38e3bb4c1d1d3961f775fdd2b342c7
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Ensure Behavior stops animating when a new value is set while disabled.

Otherwise the Behavior could cause the property value to end up in an
unwanted and inconsistent state. For example, in the following case:

x: myXValue
Behavior on x { NumberAnimation {} }

x could end up *not equal* to myXValue if myXValue was changed while
the Behavior was still animating but currently disabled.

Change-Id: I3826fdc3f48b2722e778638b116546db7e831e87
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>

Conflicts:
	tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp