Simplify indexing, address obsolete code, improve access/type checking. Reviewed-by: tschatzl, pliden
Reviewed-by: brutisso, stefank, david