centralize pointer-to-scriptvalue-attachment

Introduce attachPointerTo and attachedPointer
functions in scripttools.h.

Change-Id: I15ad41a51820035d621320b0a76978c7da0b75ed
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>