Move calculation of gravity to OctTree and smaller refactoring