add register_handler_with_condition

Link: https://github.com/GeneAssembly/biosal/issues/511
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>