Substitute spaces for underscore in dictionary keys with spaces

I have been using your library a bit today and was trying to convert dictionaries with spaces in the keys. This didn't work so well :-) I made a change to your code to replace any spaces in keys with underscores. Maybe you'd like to include this?