Revamp patching functionality and add clang patches