Make both implementation of Stack and tests more idiomatic.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>