Add missing import for std::accumulate
Fix std::iterator inheritance (first parameter has to be a category)
Be more generic for template specialization on fundamental type