UpdateStream: Internal API now uses JSON for all data.

Fix some logic bugs, increase test cases.