Fix sbt warnings.
Cleaned up duplication, added success/fail constructors, added tests.

Fixes #34.