Added TraceLogger to get backtrace for executed queries

Added a TraceLogger that returns a backtrace for the executed query.
The backtrace returns the last 10 frames, and it also formats the frames for easy reading
It should probably just assert that an instance of the `TraceLoggerTest` was in the trace: can't rely on line numbers or length of the trace, as PHPUnit cannot ensure that, nor the engine (because of weird opcode optimizations that are coming up in PHP7)