Merge querypage-work2 branch from trunk. The most relevant changes are: