fixes many bugs, particularly with signal handling. The regression tests have also been updated and complete successfully on amd64.
Reviewed by provos@