Move the database connection outside hook_queue

Move the database connection outside hook_queue, so we don't create a new connection to mongo for every email.
Merge pull request #1 from endast/patch-1

Move the database connection outside hook_queue