Vanilla JS (dependency-less) helper for navigation handling in single page apps