Bounded  types for the Stack classes

Signed-off-by: Alexander Skjolden <alex@plastboks.net>