Added Mail class. Added tests. Improved API.