Added tests and file output.
Merge pull request #2 from kkoopa/testsandothers

Added tests and file output.