Scheduled unique fixes

This is an attempt at a fix for #12 

This should just work with older versions using one as the key instead of the job id, maintaining the uniqueness constraint.

Included is a test (in the first commit, runnable on it's own) that was failing against master for me.