Open streams lazily to avoid too many open files. Closes GH-36.