Fix for diff toc ordering
PEP8
Comments, PEP8
Simplified the code
PEP8
Merge pull request #619 from khandelwal/master

Fix the content ordering of the TOC for diffs