add loop config framework
refine libdg_loop file structure