editfile: fix #7 and add tests