Fix condition for closed contours

The original code assumes that if a contour line returns to its starting
cell, it is a closed contour.  That only holds if the cell has a single
contour crossing.  This fix adds the condition that a closed contour
must end on the same edge.
Add test to verify closed contour condition
Add failing test
Fix a few spelling mistakes
Fix closed contour condition

If a cell has a saddle point, it is possible for a contour to return to
that cell without closing itself.  For example, a contour might leave a
cell through a N->E crossing, but eventually return through a W->S
crossing. This happens only if we start the contour trace from cell
types 5 or 10.  So we need to make the condition for a closed contour
more strict.  The contour not only has to return to its starting cell,
it must also end up at the correct edge.
Merge pull request #15 from tlycken/dd/fix_saddle_point_issue

Fix condition for closed contours, fixes #12