saved canonical id on load to allow updating the primary keys

Implementation of my suggestion in issue #187.