Rewrite how l-values and r-values are handled, and implement references.