Tidy up:

- Lower-cased all local variable names
- Explicitly typeset all local variable names, to prevent issues with
  setting/overriding variables in the global namespace.
- Explicitly typed integer types as integer (typeset -i) to enable simpler
  arithmetic calculations on them.
5 files changed