Bugfixes and improvements to the json sent to the API

This fixes a bug with `in_app`.

`function` wasn't set if the frame wasn't within a function. Now we use the same logic as node uses when printing stack-traces in the same situation.

Also, `culprit` is now set automatically based on the top-most `in_app` function.