reconstruct config module, add tests for it

Signed-off-by: xcgspring <xcg1987xcg@126.com>