A rebase of most of Tom's tom-pns-hole-as-first-class-object branch with bug fixes and cleanup.
tom-pns-hole-as-first-class-object