Move lastOpenFileName and dir.open preference into open method so it
also works when opening a file via command line parameter.