Allow larger k for small world graph creation.

Fixes #894
See discussion there.  These changes move degree test inside inner loop to avoid check on common case of small k.  Also adds some tests.