follow-up r61355 a bit more, still have several bits to fix (e.g. json handling)