Fix repeated classes header in sidenav

Fixes multiple <h3>classes</h3> navigation menus appearing in navigation
sidebar when using modules.

Removes magic -1 value and module counting in favor of more explicit
boolean, only appending class heading if necessary.
Merge pull request #361 from Billiam/fix/repeated-class-header-354

Fix repeated classes header in sidenav