parse reply of packing scripts for errors
fix ConnectionFailure import
add more debug log messages
fix logging
fix logging and use find().limit() instead of findOne
timestamps in log messages
add state entry to trace files

file entries in the mongo db can now have different state.  The
fillmetadata script will set the state to 'new' The pack-files script
will set the state to 'added' as soon as the file is in any container.
If the container is closed and stored the state will be set to
'archived'. If the container is deleted, the state will be reset to
'new'. The writebfid script will set the state to verified as soon as it
has entered the bfid as archiveUrl into the file entry in the db.
fix updates using $set
sort files when collecting them for archivation
Use ErrorCode 243 to indicate a restore failure
set archives user and mode

also a couple of fixes:
- sometimes opening files in the writebfids script could cause an
  exception, saying the file is not an zipfile. Supposedly this is due
  to the file not being ready in dCache. It will now be skipped with a
  warning instead of an unknown exception.
fix BadZipfile import

BadZipfile was misstyped as BadZipFile.