Assign out and ref parameters lazily

Creating a pull request to **ease discussion** of @crutt's proposed changes for #319.

Repeat: this is (at least for now) **for discussion only**.