factorize out fromListUniqM
factorize out partitionDecls
refactorize parser
parse modules