Fix compile problems and port cat_file to new API.
Add pipeline tester.
Major change in write operation:
  a temp version is created immediately upon open;
  write_version/truncate_version interfaces are simplified;
  fix previous problem with copying large files.