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.
Yes, I think I can do it with implicit parameters.  I'll push an update once I've run the Catalyst suite against my change.