Refactor plugin staging to build dir and python script compiling