Fixed sphere functions

But there are still some TODOs in there.
A little more thorough test

doublebal definitely has issues