Escape user input in json

This prevents broken json objects from being saved to the database.
Merge pull request #164 from mfairchild365/uploads-fix

Escape user input in json
Merge pull request #9 from LimeSurvey/master

Merge with Upstream