Refactor invite

This is a series of changes.
I added a context manager called "do_invitation" to perform __enter__,
task, and __exit__ which allows me to refactor out the common code
used throughout the resend/decline/accept apis.

Now we have /invite/<invite_id>/resend decline accept

Note we do ``users.save(user_doc)`` is okay because we don't change the underlying object id. This is the same as doing ``users.update({'_id': objectid}, {$set.....})`` but it's easier to update.