Update accordionNav.js

Further refactoring.