Make diff options extraction common

Currently the logic is duplicated in ```Repository.xs``` and ```Tree.xs```. Also add missing diff flags to handle binary files.