Failure in __str__() before any output.

When calling str() on a spawn class object before
it has any command output, the __str__() override
attempts to truncate long command output while the
value of self.before is still None, raising:

    TypeError: 'NoneType' object has no attribute '__getitem__'
use isinstance of 'str', not 'basestring'
Merge remote-tracking branch 'upstream/failed-str-self' into debugging-linux-teamcity-agent-f
Use a @trace decorator and disable __str__()
Add testrunner fork drection