New Foraging, ailogger

Some changes to ailogger to improve .mat file creation.
Some changes to foraging also for the same reason.