add getBackTrace() function to help displaying stack traces.
add support for outputing std:endl, std:ends, std:flush for improved compatibility with existing code using STL's "cout" and "cerr"