Start of Stage-1: Adding Comments to extract-partitions.py

As part of refactoring and testing extract-partitions.py,
first step is a code walk-through, adding code comments
helps understand the algorithm as well as crudely
document the code. First set of comments have been added.