Refactored re-run to only allows transactions that can be rerun

This PR relates to issue: https://github.com/jembi/openhim-core-js/issues/264