[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.
In SchemaRDD, It need an chance to convert the tuple in self._jrdd into namedtuple for map() and reduce(), so I think mapPartitions() is an good place to do it.

So, SchemaRDD.map() -> SchemaRDD.mapPartitions(), other API, which did not need namedtuple, just like runJob() will call RDD.mapPartitionsWithIndex().

The goal is to avoid the unnecessary convertion from tuple into named tuple.