Lightweight R classes via closures