Fix dft_tools, # 24.

- Fix and add a test for pickling.