Add an option to disable NavigateTo feature

Also did various cleanups in the codebase.