Added support for patches
Added tests for patch functionality
Updated documentation for patches.