How to get main menu to highlight the link to the current page?
normally this is accomplished via css in the theme, with the active attribute:

li a.ctive {
  ...
}


it is not core functionality. You could look at the different -child pseudo-elements to tweak it, or use some JS, but I think that portion of the question would be off-topic here - you are better off asking on stackoverflow