Implement stdouterr for #504. Add ISink interface for cleaner implementation for #489.