Replace internally-used sets with frozensets.  Fixes #25.