critical bug fixes

save files before building project
open last project and open project.xml projects and hxml files.
Fix for CM