Configuration option for Barnes-Hut to menu. Some refactoring.