Some browsers get ajax data as string, so parse it into JSON if so.

Also make more hasOwnProperty checks.