Use and adapt to more recent checkbashisms.pl. Some refactoring.