Replaced stack implementation to be based on supplied max frame size and
implemented more direct stack operations.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>