Improve test library, and directory change