Merged requested to merge free-sorts into master
Freeing the sort indices and tasks arrays before repartitioning makes that memory available so that we have more room for accepting particles from other nodes.
Part of #98 (closed).
Also adds a useful debug function that reports the current memory usage of the process tree (i.e. call from main thread to get all usage). Same numbers you get out of the top program.
Free the task arrays and cells are refactored into simple functions to cut down on cut and paste.