#759 PR followup

 * Renamed opts.id to opts.hash in the sendEmail API
 * Various code/jsdoc cleanup