Cleanup code
Add support for passing callback to navigate
Use navigate callback to update analytics information
Use navigate callback to update analytics information