compile PS modules to Lua modules and handle imports