Minor tweaks to main library, added "proc2csv" and a debug/test script