Cleanup checks previously registered by name

That also have an id and that now will be registered with id in the
path. Also add specs for this and for other check_def logic.