Make history() return json.
Merge pull request #319 from psftw/bugfix_history

Make history() return json.