Mainly code for data structures generation

In addition, augmented the logic for handling un-partitioned LPSes in
the next-LPU generation logic, which was missing in the previous commit.