Fix memory leak pointed out by valgrind
More bounds checking
Improved diagnostic output
Improved diagnostic output; making sure end() iterator is valid after clear()
Merge branch 'master_osx_test' of https://github.com/albertjiang/gambit into master_osx_test