Fix problems with stored properties

Properties was not instance specific for GenericMapping. This caused problems in
generating the unit ids. In addition, I've added some methods for getting the
first and last residue as well as simplifying the logic of generating the
residues.