Added error handling, improved file storage procedures, many bug fixes, file format validation, etc