Make set-state etc async as well, by using an atom