Implemented invite feature (with accompanying tests)