Added protection to prevent opening an open io instance and to prevent closing a closed io instance.
Added Plugin modes and directory to the config parser