Documentation
Bugfix usage of "set -o errexit":
- We also need "set -o errtrace" since we want it to catch errors in subshells which we create with "()" etc.
- We need a trap upon ERR to print the line number since I have encountered an issue which causes error exit without bash printing any error message. It will be fixed int he following commit.
Fix exit failure due to "let" / "set -o errexit":
"help let" says: "If the last ARG evaluates to 0, let returns 1; let returns 0 otherwise."
The return status of 1 would also apply to "let count++" since the value of $count is evaluated before the increment due to the post-increment operator and $count is initialized to 0.
So we have to use pre-increment because we use "set -o errexit" and the exit failure of "let count++" would trigger it.

Notice that this commit changes all uses of let to pre-increment preventively since we don't need post increment anyway.
Also, once instance of a counter variable is now explicitely initialized to 0.