Add arg-sample code

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

I think this could also benefit from passing by reference.  For example, if you did this:
```c++
NodeMap(map<int,int> &nm) : nm(nm) {
```
then only the `nm(nm)` part will do a copy, which I believe is the intent.