Builds JSON file using PHP object and json_encode().

Also, adds thumbnail support for timeline entries.
And also removes the unneeded closing PHP tag.