Looks like you are committed to Bash 4.x
Mostly I was committed to working working command line editing on very long lines that wrap across multiple lines, and at the time (Tiger) Mac OS X bash was not cutting it, so that is why I built my own newer bash.
The following script that incorporates associative arrays and process substitution works fine on Mavericks, and likely ML, and Lion with Bash 3.2.
I absolutely love process substitution. It solved so many problems, where in the past I would have to implement a complex workaround. When I look at shell scripting books these days, the first thing I do is check if the author has provided any process substitution descriptions and examples.
Your script is good, however, the arrays are the numeric indexed arrays, not associative arrays. NOTE: I only bash arrays numeric indexed (like I said, I only switched to 4.x because of command line editing, not array features. Although thinking about is, if I need an associative array, I'm used awk or perl and spit the processed answer out for bash to use. Maybe I should be thinking about implementing directly in bash. Interesting).
Here is a simple example of associative arrays in bash (it doesn't really do anything useful, just demos associative arrays):
#!/usr/bin/env bash
declare -A a # create associative array
a["abc_key"]=def
a["qrs_key"]=xyz
echo "${a[@]}" # display associative array contents
echo "${!a[@]}" # display associative array keys
echo "${a["abc_key"]}" # use key to access value
echo "${a["qrs_key"]}" # use key to access value
exit
$ bash associative_array_example.sh # run the example
def xyz
abc_key qrs_key
def
xyz
All of my shell scrips, and I have lots of them (one 13,000 lines long) can run in bash 3.2. And for all I know, the very long command line editing issues I had back in Tiger have been cured. But as my 4.x bash isn't broke, and I have copies for Mac OS X, Linux, Solaris, and AIX, it gives me a stable command line environment to work in.