Fix moving of attachments to allow both directions (db<>disk)

This basically builds on the work Damien did before.

In addition, tidy up the file api for later merging into the new db layer
and fix support (;() for oracle in the soap api for file handling.