Cleanup and documentation of dictionary functions.