[FIX] Index#retrieve returns nil when the document doesn't exist

Previously an exception was raised on document.update(h['fields'])
since h['field'] returned nil:

    index = Tire::Index.new("empty")
    index.create
    puts index.retrieve("doc", 'NOTEXIST').inspect

Closes #193.
[FIX] Fixed incorrect curl format in logger for Index#open

Closes #195.
[ACTIVEMODEL] Added the `:as` option for model mapping to dynamically set property value in serialization

Example:

    class Article
      belongs_to :author

      mapping do
        indexes :author, as: proc { author.name }
        indexes :author_email, as: 'author.email'
      end
    end

Ccloses #184, closes #186.
[ACTIVEMODEL] Added documentation and more tests for the `:as` option

Related: #184, #186.
[ACTIVEMODEL] Added injection of the `paginate` method when missing (Kaminari)

The `paginate` method, needed for the import task, is injected in the class being imported
when the class implements Kaminari pagination, so the import Rake task works out of the box.

Closes #191. Also see: #48, #108.
[ACTIVEMODEL][FIX] Fix the incorrect translation of namespaced models into `document_type`

When loading the namespaced models from ES, the exception: "NameError: uninitialized constant" was raised.

This is due to the fact that ActiveModel does, for reasons unknown, funky shit here: <https://github.com/rails/rails/blob/v3.1.3/activemodel/lib/active_model/naming.rb#L50-52>

Closes #189.
[REFACTOR] Changed that the Search::Search#perform method is lazy loaded (allows chainability)

DSL#search and Search::Search lazy load data and are chainable, until #results or #response called.

This allows something like this:

    s = Tire.search('articles') { query { string 'title:T*' } }
    s.filter :terms, :tags => ['ruby']
    p s.results
[REFACTOR] Added documentation and cleaning up tests for the lazy loading of results
[TEST] Fixed test failure because of "/" in `document_type` of namespaced model

TODO: This is related to patch in #189, and actually means namespaced models cannot be used with Tire.
[REVERT][FIX] Fix the URL-incompatible translation of namespaced models into `document_type`

Revert "[ACTIVEMODEL][FIX] Fix the incorrect translation of namespaced models into `document_type`".

The "proper" translation translates `MyNamespace::MyModel` to `my_namespace/my_model`, which
allows proper loading of namespaced models, but fucks up the encoded URL, because of something like:
http://.../indexname/my_namespace/my_model/_search?...

This reverts commit 89bc6639e6c92ebf1decc1e934c894df5053164e.

See #189.
[DOC] Fixed global facet example in documentation

Closes #227.
[GEMS] Updated Turn dependency and relaxed ActiveRecord dependency version

NOTE: Supermodel depends on ancient version ofActiveModel: 3.0. Replace with another "generic activemodel" or sort it out somehow.
Merge remote-tracking branch 'upstream/master'

Conflicts:
	lib/tire/tasks.rb
Prefer ELASTICSEARCH_URL environment variable as a default URL, if present

Note: Main reason is frictionless deployment at <Heroku.com>

Closes #240, closes #241
Added "text" query as part of the DSL [#168]

Example:

    Tire.search('articles-test') do
      query { text :title, '+1' }
    end

See <http://www.elasticsearch.org/guide/reference/query-dsl/text-query.html>
Improved code structure, added unit test and separated integration tests for the "text" query implementation

Closes #168.
Prepare release 0.3.13 (pre-release version)
[FIX] Added encoding header for DSL example file

(Reported as #257)
[FIX] FilteredQuery: chain multiple filters with `and` by default

Closes #254, closes #255.
[FACETS] Added support for "statistical" facets [#252]

See http://www.elasticsearch.org/guide/reference/api/search/facets/statistical-facet.html