API cleanup

Made some of the proposed API cleanups. The `graph` package now has a `CostFun` definition which defines a func with the signature func(Node,Node) float64 as a cost function. This is replaced where applicable in the search package.

I also made the proposed change of making setupFuncs use an unexported struct for storing function pointers. Tests still pass, this was an internal change only.