file function rename, added a test macro, added more tests, and added file locking