Cleanup and adapt to new memcheck output format.
Renaming, polishing and minor bug fixes.