ContactMap fix and extension

Fix for #91, there were problems when using the keyword SUM
(components were still defined and derivatives were not allocated)
I have also added a keyword CMDIST to calculate the square
distance with respect to a reference map.
This close #90 #91.