Restored -datadir and -langdir arguments, added -savedir

Also, fixed some crashes when unable to open file