Improved queue processing

processEmail function now has better collision handling in case multiple servers are responsible for processing emails.
processQueue function now handles pagination and provides an optional queryPeriod for limiting the result set.
Better error handling

More comment documentation and better handling for errors thrown when processing incoming emails.
Fix typo in outgoingId

also wrapped id set in a null check (Mongo doesn't treat explicit nulls as non-values for sparse index purposes)
Added a default reject function

in case we forget to write a more customized bounce email.

Also fixed the mailgunId field (useful for retreiving the missing message if it wasn't stored in the db)