Io redirection

Allows output redirection. Closes #5.