Add stackData to debugbar logger

In the case of a redirect, stackData saves the current log, and it will be
available in the debugbar of the redirect page. 

To implement, had to resolve issues with the way the events are triggered.
System module grabs core.include.functions.redirectheader and does the 
redirect in most cases, so we cannot reliably chain off of this event. Added
a new event core.include.functions.redirectheader.start so we can get the
event in time to do the debugbar magic.

Cleaned up some things related to the redirect events that won't get triggered.
Fix errors in database error message build