Fix for events not being fired on iOS (#234)

Used NSJSONSerialization to properly encode JSON so javascript is eval'd without 'Unexpected EOF' error.