fix a giant bug:
- inserting a nil certname results in an empty String being used for the value
- this means we get a match anytime we do #find_by_certname
- so, check if the certname value is nil/empty. if it is, just make @host nil
- after that, the existing registration logic will suffice and all that is
required is that the validate_params use the value if it is present
- also added some additional logging statements