Added pushError method to application to add error handler to bottom of stack. Closes #1528.
Merge branch '4.0'