turned email.js to a library