Add output parameter support and test.

Okay good, as long as someone is able to follow.  I can't seem to keep this straight in my head :)