Lots of clean up work; also made lots of updates to design doc.