remove declare -g for bash 4.0 compat

- declare -g is 4.2+ only
- modified bash version check