Debugging improvements

See the changes to the README for details of what this branch adds.