This mechanism will need a ratchet in it

so it ratchets when you pedal forward and pulls the cable when you pedal backwards. Adding a 2nd cable to work both wheels could be done. They do that now for hand controls. Balance of breaking would be critical. Not sure how doable that is, but overall looks like it would work ok.
(The way its drawn here it seems to be pulling the cable when you pedal forward, so it would need to be like this below the BB)