Added "flexible_stack" template class.