Remove 'clean up' code from search_state.js, as that sort of thing is best done externally.