Add reverse_arcs function
Fix reverse_arcs function and add unit tests for it
Pull in changes from otherlab/core