improved test
- fixed testPermanentDeleteFile sometimes failed
- speed optimization
- reformat code
added users for tests
reformat code to meet coding guidelines
Merge branch 'stable5' into fix_enc_migration