Redirect stdout instead of using IO#popen.

I find it more comfortable to not create a new process to capture
output. This redirects standard output to a variable, which captures the
created configuration, by using StringIO.