Fix basic errors that crept in from too many interrupted-in-the-middle evenings. It builds, can get into a REPL, and spectacularly fail pretty much all its unit tests