Have mostly added the general file handling stuff.

Need to finish the generic message handling (move away from BSON only)
Also need to define the periodic wipe and such
Lost of testign after that