Move require for stringex to correct location
[WIP] Cleanup permalink deduplication

* Kill the deduplication via suffix appending on validation.
  Not needed as we generat a unique value initially.
  There is a small chance that multiple threads generate the same random
  value the same time and persist it. This was possible before and after
  this change.
* The extra LIKE queries being caused by the deduplication code have a
  significant performance impact as they cause a sequencial scan on
  unoptimized schemas.