Working on the branchmine code
more work on the branchmine program.
started refactoring some of the api's and data structures to be a bit more flexible.