added invite code support

https://github.com/pfraze/phoenix/issues/188

@dominictarr ready for review