0.8.x port of the git crate with added functionality

Notes:
 - the branch? function probably needs to be reworked to work with pallet.algo.fsmop ?
 - the tests could use some help too