Adding test to lib.ensure_dir()
Additional tests for v1 api. Fixed broken test for lib