Added more binary mode functions
Add support for autosaving the state and restoring it on the next load