local class support (+ tests, tuning and related fixes)