Upgrade to aasm four

upgrading AASM to version 4 and fix the places where it is used