Add state classes

TODO: handle resources(like canvas and images) better