Added missing standard library includes for gcc 4.8

I got away with switching the order of <memory> and <array> in cppversion.h and adding <algorithm> at only one point. This works for gcc 4.8.2 with ACML