Refactored to use read() write() methods added to filestore.php.