apply message type classes to the message element if no container is provided
switched .getState() and .setState() for .isValid() and .setValid() methods since the only remaining state that hasn't been moved to separate methods is valid/invalid. Also changed the control is-valid/invalid class to apply to the control without waiting for the message transition to finish