Tests: base class cleanup
Tests: fix in_main_loop naming style
Replace: fix bug on replace in dir in opened file