Create database fields to relate users as referrals
Generate referral code to new users
Allow users to register using referral codes
Define referral_url method for each user
Keep referral code between requests storing it in session
Remove Google Analytics's "Reference" custom variable

Does not have a reason to exist, so get's out with the same reason.
Remove referral urls from db

Wasn't being used.
Use "ref" as parameter of referral code
Use referral_code directly from session accessor
Merge pull request #664 from neighborly/im-referrals

Referral system