better error messages and more control of callbacks into Lua
manually apply @ryugwang pull request #10 fixing remove_dir