Added an optional context to stacks. Closes #94. Closes #10.