Move DefaultFileManager from java to scala

- Add tests for DefaultFileManager
- closeCurrentFile does not close all files when there is no current
  file to close
- Remove unused methods flushFile, currentFile, getPrefix from
  FileManager trait