game: move platform-dependent stuff into Platform class

also make all file-accessing classes use Platform class