[scala] Add withParameters() support for sinks/sources

This closes #261.