Added tests.lib module with `replace_*()` with statement functions

Note: there is new problem: now multiprocessing() globals got assigned None 
values. It is likely somehow related to extended `sys.modules` utilization