Reorganize libs and core script files in different directories (2)