How do you stop the water sloshing out of the water tank with the pump in the tank?

Depends your water container really. some have rubber flanges with holes in them, some have screw off tops with holes in them, some slosh about!

We use these caps - the central hole needs drilled out to the size of your pipe, the second hole is for the cable to drop through.