Add arg-sample code

@mjhubisz

This PR addresses issue #9 by merging the code needed for `arg-sample` into master.


Here I think you also want to pass by reference.  You want to also want return by reference as well.  That depends on how you usually use this operator.