Lots has been fixed

Want to do one more go through of the code since I'm sure there is still
stuff not quite done right, then we can get to testing.