Implement file output (fixes #9).
Merge pull request #23 from twaugh/file-output

Implement file output (fixes #9).