combine content_to_json and form_to_json

use first character to determine if it looks like json and go from
there.