Implement auto invitation

I've implemented simple invitation logic just as an example of how it can be done.