(b) For the purposes of this article, a contention or contentions and the grounds in fact or law relied upon in support thereof shall be deemed to have been previously and finally adjudicated only when at some point in the proceedings which resulted in the conviction and sentence, or in a proceeding or proceedings on a prior petition or petitions filed under the provisions of this article, or in any other proceeding or proceedings instituted by the petitioner to secure relief from his conviction or sentence, there was a decision on the merits thereof after a full and fair hearing thereon and the time for the taking of an appeal with respect to such decision has not expired or has expired, as the case may be, or the right of appeal with respect to such decision has been exhausted, unless said decision upon the merits is clearly wrong.
(c) For the purposes of this article, a contention or contentions and the grounds in fact or law relied upon in support thereof shall be deemed to have been waived when the petitioner could have advanced, but intelligently and knowingly failed to advance, such contention or contentions and grounds before trial, at trial, or on direct appeal (whether or not said petitioner actually took an appeal), or in a proceeding or proceedings on a prior petition or petitions filed under the provisions of this article, or in any other proceeding or proceedings instituted by the petitioner to secure relief from his conviction or sentence, unless such contention or contentions and grounds are such that, under the constitution of the United States or the constitution of this state, they cannot be waived under the circumstances giving rise to the alleged waiver. When any such contention or contentions and grounds could have been advanced by the petitioner before trial, at trial, or on direct appeal (whether or not said petitioner actually took an appeal), or in a proceeding or proceedings on a prior petition or petitions filed under the provisions of this article, or in any other proceeding or proceedings instituted by the petitioner to secure relief from his conviction or sentence, but were not in fact so advanced, there shall be a rebuttable presumption that the petitioner intelligently and knowingly failed to advance such contention or contentions and grounds.
(d) For the purposes of this article, and notwithstanding any other provisions of this article, no such contention or contentions and grounds shall be deemed to have been previously and finally adjudicated or to have been waived where, subsequent to any decision upon the merits thereof or subsequent to any proceeding or proceedings in which said question otherwise may have been waived, any court whose decisions are binding upon the supreme court of appeals of this state or any court whose decisions are binding upon the lower courts of this state holds that the constitution of the United States or the constitution of West Virginia, or both, impose upon state criminal proceedings a procedural or substantive standard not theretofore recognized, if and only if such standard is intended to be applied retroactively and would thereby affect the validity of the petitioner's conviction or sentence.
(e) The writ of habeas corpus ad subjiciendum provided for in this article is not a substitute for nor does it affect any remedies which are incident to the criminal proceedings in the trial court or any remedy of direct review of the conviction or sentence, but such writ comprehends and takes the place of all other common law and statutory remedies, including, but not limited to, the writ of habeas corpus ad subjiciendum provided for in article four of this chapter, which have heretofore been available for challenging the validity of a conviction or sentence and shall be used exclusively in lieu thereof: Provided, That nothing contained in this article shall operate to bar any proceeding or proceedings in which a writ of habeas corpus ad subjiciendum is sought for any purpose other than to challenge the legality of a criminal conviction or sentence of imprisonment therefor. A petition for a writ of habeas corpus ad subjiciendum in accordance with the provisions of this article may be filed at any time after the conviction and sentence in the criminal proceedings have been rendered and imposed and the time for the taking of an appeal with respect thereto has expired or the right of appeal with respect thereto has been exhausted.