File Open modes: Use an real enum instead of const values

This will also silence compiler warnings about sign mismatches
Merge pull request #6 from gicmo/file_modes

File Open modes: Use a real enum instead of const values