log unhandled exceptions
Merge pull request #24 from czardoz/master

SMTP capability, unittest
code cleanup