[js] Greatly simplifying the navigation stack and cleaning up the UI