Sort modules and set publication status