cleanup, merge Jeromes code, perfdata output fix (rev 5.1)