delete records from related and related_dataset when clearing source

This addresses the issue #108 

If there is a better way to insert the ids than by building a string then please let me know :)