Merged MID into SUBSTRING, unified testing of SUBSTR, MID and SUBSTRING

Merged two different implementations of MID and SUBSTRING. MID is now an alias of SUBSTRING, like SUBSTR.