improved test
- fixed testPermanentDeleteFile sometimes failed
- speed optimization
- reformat code
added users for tests
reformat code to meet coding guidelines