Add arg-sample code

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

minor nit: could calculate leaves by `(nnodes-1)/2`.