Add arg-sample code

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

This does a copy operation when returning `postnodes`.  The previous `getTreePostOrder()` design avoided this.  Was original function not working for you in some way?  I suppose it was less convenient that the caller had to allocate the `postnodes` array.