Initial logic for applying patches.
Add darwin specific patch for tree@1.6.0.