[WIP][SPARK-2097][SQL] UDF Support

Remaining:
 - [x] Python Support
 - [x] Python Test cases
 - [x] Move out of hive
 - [ ] scala Test cases
 - [ ] Input coercion?
PEP8: function define should be have one empty before it.

Or you could use lambda here in one line.  func = lambda _, it: imap(f, it)