Minor changes.
Basic refactoring.

- Update comments;
- Rename argument "err" to "error" for better readability;
- Reduce nesting level of the directory processing code.
Remove .gitignore in favor of the global one.