Implement binpatching

Signed-off-by: Ross Allan <rallanpcl@gmail.com>
Merge remote-tracking branch 'upstream/master'