Added more of the orphan removal code.  This is the first version where orphan removal is working, at least to some degree.  Further testing is needed.