compiler/libec: Using proper class for typed objects (Fixes #157, #452)