Some changes in ml/agonas.sml
Changed list to list ref in values passed to functions