Capture root errors

When an error was happing at a global scope (right inside a <script> tag), it wasn't generating frames properly because the regex pattern wasn't matching the line.

This fixes that and makes the "funciton name" portion optional and uses a "?" instead of trying to go up the stack and determine which function called it, since there is no function.