Generic stack implemenation

Preparing patch for issue #67. It implements a generic stack, which will be used to store the IDs of the current scheduled flows