Implemented save and load of vms files. Some performance optimization made.