Changed function stage into jQuery style.
Refined removeStage and insertStage.
Added test cases for stage related functions.