Implement --file option.

Resolves #1.
Merge pull request #2 from anandthakker/master

Implement --file option, with associated tests.