Referral system

Closes #660.
What about just using `ref` as the param name?