[SPARK-4387][PySpark] Refactoring python profiling code to make it extensible

This is a refactor of the [profiling feature](https://github.com/apache/spark/commit/c5414b681868a0a11cc5a94184116e66e8d3e9c0) done by @davies 

This will allow us to hook in custom profilers and output sinks more easily. 
In order to have this as an example in API docs, it need to be moved into BasicProfiler

Also, import BasicProfiler into pyspark/__init__.py

you can build the API docs by 
```
$ cd python/docs/
$ make html
$ open _build/html/index.html
```