Add more cpp tests for harmonic potential

Mostly adds some tests.
Also replaces some explicit for loops by pele::dot function.