Refactor build_patchers into class. Fix issue with patching non existent attribute with hasattr.