Added locking of files
Tried to move file storage more inline with new plan
Improved locking... ish