r?ply issues

Seamless support for both expressions and functions in the r?ply family, maintaining consistency for both side effects and output.

Fixes #158 and #164. Rebased variant of #165.