patch to include uncaught exceptions to error JSON

I found that uncaught exceptions didn't print the stack, only '{ uncaught: true }' so I borrowed shamelessly from base.js to process & include the stack message.  I also cleaned up some more of the comma-firsts