Don't send invalid data and parse more stack traces.

This pull requests includes two sets of changes. The first makes sure the data sent to the squash backend is always valid. Previously the javascript client could send data the wasn't accepted by the backend, causing failed requests and errors that were not reported.

The second allows tracekit to parse stack traces from javascript served from https urls.

I've made it one pull request; let me know if you prefer two separate ones.