Move diff/patch library to separate package