menu dividers now automatically disappear

dividers and headers are now automatically removed if no visible entries
are between them ('disabled' entries count as visible).