Alter menu item markup in Drupal 8 I am trying to play around with Drupal 8 menu. How I understand now menu is a service, so how to alter menu output in Drupal 8? Is there any documentation? Because googling show no useful results.

What I am trying to achieve is move active class from &lt;a&gt; element to parent &lt;li&gt; element, this should be possible to do in .twig template (I wouldn't like that) so how to get menu in Drupal 8 and alter it's attributes?
There is one central problem: the active class is not always added in PHP, but 
for non-anonymous users its calculated using some javascript, see "active-link.js".
For anonymous users, its calculated in 
\Drupal\system\Controller\SystemController::setLinkActiveClass