Added support for Thrift (like pyes). Refactored code

Added support for Thrift transport (https://github.com/elasticsearch/elasticsearch-transport-thrift).

The syntax remain the same, but now the code is more modulated and extensible.
:)