Just to json

Sorry, this also includes the commits from #4.