Minimalist working version with AOT class serialization for functions