Add persistent stack to meta::util.

This will be used in representing the parser state for the shift-reduce
parsing algorithm so that keeping multiple different states (with similar
history) in the agenda is not prohibitively expensive.
Add initial implementation of training for the shift-reduce parser.

This is completely untested code at the moment. Furthermore, it's not
actually doing a full beam search: it simply applies the best transition
according to the model at each step, and if that transition is guessed
wrong the weights are updated and the algorithm moves on to the next tree.

The weight updates are actually done in mini-batches.