Updated fix for issue #143 - log capture started too late

This commit ensures that setup_capture() is called before the parse library
has a chance to log anything. The unit tests have been updated to mock setup_capture, since it was relocated to the main run() method.