major revamp in partitioning

Halfway through. Partinining *mostly* works, but still miss the linking
step.