Minor Improvements.

Added a stack_t element. The function stack_pop returns a value instead
of copying it to a buffer.