move json support out of Session

we need json support in other places, so let's make it a
more generic and available as helpers.

We will also need some special handling for oSocial json
later - just prepare that for now.

mpn