Fixes failing tests
- mainly refactoring tests
- validation for certificates changed slightly (certs get renewed 3 month before they expire, not after half of the expiration time; fixed validation behavior for certificates that are not valid yet but will be in the future)