Did some more work on the invite system, refactored and neatened some code, and did some bug fixes