[SPARK-2010] [PySpark] support nested structure in SchemaRDD.

add API: applySchema(rdd, schema, f=None)

It need the new API to support nested structure.

It will do inferSchema() in Python, then convert the namedtuple() or other objects into 
tuple() (using dict currently). Before call SchemaRDD.mapPartitions(), It will convert 
the tuple into namdtuple, so user will access name fields like normal objects.

Because the type of returned data from collect has changed, so unit tests still failing, 
will be fixed later.
If you want to override the function that other maps depend on, it's better to override mapPartitionsWithIndex, unless I'm missing something. It looks like you changed all of the code to use mapPartitions instead of mapPartitionsWithIndex, but some users may still call mapPartitionsWithIndex.