Add really hacky DB migration thing. Further optimise search_state responses.