Reorganise mf module; more dynamic unittesting and logger level setting