SPARK-2407: Added internal implementation of SQL SUBSTR()

This replaces the Hive UDF for SUBSTR(ING) with an implementation in Catalyst
and adds tests to verify correct operation.
Would it be possible to do this without view bounds?  I think those are going to disappear soon: https://issues.scala-lang.org/browse/SI-7629