Add clear function (stack_clear) to stack_t.

Clear function was added to stack_t, along with corresponding test
functions.