Switch from using 'var' to 'ref' for return intent

This changes all occurrences of RET_VAR to RET_REF in the compiler. A
warning will be displayed to the user if they try and use 'var'.
Update module code to new ref return syntax

The majority of the changes were done via:

`gsed -E -i 's/((proc|iter) .* +)var/\1ref/' [files]`

with a few outliers changed by hand.
Update our tests to the new ref return syntax