change 'class' by 'typename' in all templates

Just a small Pull Request, Ricardo, please try to merge to see if rights are ok, thanks.