Fixed flakey tests

Assuming return value of time() and microtime() will increment by 1 when called every time, some issues will appear. (microtime(true) - $time will always greater than 1.) Also, $config is possible to be null when calling set_config.
Then inject the config object into the method calls that fail... not setting the config is wrong