Change to a functional style immutable stack implementation

In order for the pop to both change the state and return a value, we had to
introduce another class 'Pair' that wraps both.
In the same way, push now returns the new Stack.

The stack implementation itself does not change and still uses side effects.

As the empty stack is 'null' all methods became static

The isEmpty method disapeared in favor of a direct comparision with the empty stack.
Use Stack static import to remove some code from tests.
Try to refactor using a Pair inside the test

The result is still not great

Let's see if we can get something better by using the pair everywhere on the Stack
Stack.push now returns a Pair.

Some duplication was removed, and the tests look better.

It's still a bit weird though ...
Helper pair() building methods

We are starting to spot a strange repetitive construct in our test code

pair = f(pair,...)
pair = g(pair,...)
...

Let's see what we could do about this
Isolate pops and pushes through function objects so that they can be manipulated

It gets really weird, but it will become clearer
Create real StackFunction classes for stack operations

The test body is now more normal, and some duplication starts to appear.

Let's continue on our road
Use the Stack function objects all over the place

Let's see how we could present our code differently now
Use a do_ method to execute the stack operations

The code is starting to get interesting : we are writing code
that looks like imperative code but only with immutable data !
Move StackFunction to Stack.Function and extracting the bind method to Pair

We extracted the Monad bind function. Pair is the monad !

Let's make this more obvious
Extract Monad<T> interface

For the moment, it is mostly documentation
Also rename Pair to StackAndValue
Move methods to Stack for cleaner code