Use std::hypot and 2.0 double, and set constness

This is just a minor change.

I'll have to go now into more serious melding, probably missing some stuff.
Note that I haven't compile/test this atomic commit!