fix inheriting from lists, and make type() behave correctly w.r.t. classes