Feature/output streams

RFC, not ready for merge yet.