Adds setnx support and some accompanying tests.