trying to get reduce working properly

- fixed: debug.pl was still using test/1
- split predicate by_type into by_type_id and by_type_name, hopefully
determ. (untested).
- next -> next_action, splitting shif and reduce cases,
and added special handling for EOF (which cannot be shifted apperently)