Started fwrite

Added fileID validation function
Started work on write to mem
Minor fixes

Added is_open function
Normalized error/warning messages