Rewrote aid_list handling, split into functions, fixed userdata handling.