Added pstage support [#1]. Also refactored to remove some design which is no
longer valid.

1. no more Stage record, now using a map to pass specs for a stage
2. no more named-stage, now as an option of stage