Convert update-state! to a macro, fix ns assumption