Refactor handling of triple store changes

This will fix isse #20 when complete