Export PatchFromBuffers function.

This change also factor out diffOptionsToC function to remove
duplicated code.
Merge pull request #148 from joseferminj/export-patch-from-branches

Export PatchFromBuffers function.