Moved AEvent to contrib and fixes some build issues.