Made stack a template class.