Fixed #262 resend invite gets new link. Fixed #258 refactored invites.

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.