Add pfaffian helper script, some minor improvements to others.