Use QTest::toString()

Use QTest::toString() instead of custom ToString() template function to
convert values into string.
Fix small memory leak
Copy exception message to prevent corruption
Activate C++11 support