Added random_stack for tests, and pushid_popd testcase