Span front() and back() methods and SpanPopBack function backport
Span front() and back() methods and SpanPopBack function backport

from btc@2b0fcff7f26d59fed4bcafd1602325122a206c67

Darknet-Crypto/Darknet,PIVX-Project/PIVX,PIVX-Project/PIVX,Darknet-Crypto/Darknet,PIVX-Project/PIVX,PIVX-Project/PIVX,PIVX-Project/PIVX,PIVX-Project/PIVX,PIVX-Project/PIVX,PIVX-Project/PIVX,Darknet-Crypto/Darknet,PIVX-Project/PIVX,Darknet-Crypto/Darknet,Darknet-Crypto/Darknet,Darknet-Crypto/Darknet