Re-works invitations model. Adds Brian's predict 4.0 Ruby code into /lib.