Allow set title to function return value

Now it is possible to set document.title value to function return value
Merge branch 'patch-1' into tests