Some refactoring for ensure and ensureNot
Allow $exception parameter to be Exception instance