Full delete support

Fixed delete bug that caused double deletes on line deletes.
Also added some comments to clear up some code ambiguities.