mergetool--lib: simplify API usage by removing more global variables