Documented and refactored Patches module.