Add bug fixes for agreementvm modularizing and fixed shared vars.