The case for state machines in client-side applications