Generic cross-browser functions for getting keys and values from a dictionary.