CompositeController (prepareNextViewOptimized): use sendQuery() when non-JS.

The show() command does not work properly with HttpCommandReceiver.
Json Renderer (render): use json_encode() to produce STATE hash.

The serialize() function chokes with Closure objects.

Fixes commit:897cdd1
Js UI: use history.pushState() API for history navigation.