All of these things can be done by using the HTML5 file APIs. Here are some links which will help you with your task:
- http://www.html5rocks.com/en/tutorials/file/dndfiles/
- http://www.html5rocks.com/en/features/file_access
Storing state can be accomplished by using one of the following technologies: