Update itree import script

Make the itree import script a bit more user friendly
by adding the following:

If you are using the standard naming (for example:
AQ_Ozone_dep.csv you can omit the column name)

If you are loading the standard set of csvs you
simply provide the absolute path to the directory
containing the csv to process all the recognized
files
Merge pull request #29 from ahinz/topic/fixscripts

Fix import scripts
Fix tearDown function indent in API tests

This function was not being run because it was not in the scope
of the TestCase subclass.
Refactor stewardship for better performance

This commit also does some general cleanup around stewardship
searching.

Previously the main stewardship search code did something like:
s <- DB(SELECT DISTINCT tree_id FROM treemap_treesteward)
for a <- actions:
  s <- DB(SELECT tree_id FROM treemap_treesteward WHERE
          tree_id IN ( ... s ....) AND action = a)

Not only does this require len(a) database queries, if the
number of stewardship entries is largish the "IN ( ... )"
clauses will fall apart.

A better way is to embed a query into the model (models.py#1218)
that does a proper group by / having and returns only the
data we need
Merge pull request #36 from ahinz/topic/cleanup

Remove old files
Refactor searching

Previously the secret _build_tree_search_result was a 600+
line method of very dense and sort of crazy python

The new approach offloads most of the searching code into
search.py

search.py is essentially a set of "apply_X_filter(req,searchObj)"
methods.

When apply_filters(...) is called, it iterates through each filter
and applies it in order.

There are still future things that need to be done:
* It sucks that we have to repeat ourselves with the plot__/tree__
  stuff everywhere

* Each "apply_X_filter" method should probably have its own test
  (note that most are already covered by the search integration
   tests)

* Stewardship stuff still scares me a bit

* The "append" methods called on tile_query should instead
  create new arrays. This would gives us true referential
  transparency
Fix typo in Version test case
Merge pull request #37 from ahinz/topic/search-refactor

Refactor searching (and bring stewardship along for the ride)

This pull request is NOT related to FB25140 (advanced search error) but it seems better to fix the problem with this new framework
Update API to bidirectionally convert choice values

Greenprint requested that the number of tree condition values be
reduced. Because the iOS application has the choice options embedded
in a config file, the API must be able to bidirectionally convert 'old'
choices to 'new' choices.

This commit accomplishes this by:

1) Defining a schema for settings.CHOICE_CONVERSIONS where forward and
reverse choice conversions can be defined and triggered by mobile platform
and version. Example:

    CHOICE_CONVERSIONS = {
        'condition': {
            'version-threshold': {
                'ios': '1.2'
            },
            'forward': [
                ("1", "8"),
                ("2", "8"),
                ("3", "9"),
                ("4", "9"),
                ("5", "10"),
                ("6", "11"),
                ("7", "11")
            ],
            'reverse': [
                ("8", "1"),
                ("9", "3"),
                ("10", "5"),
                ("11", "7"),
            ]
        }
    }

2) Adding a helper method to parse version information from the
ApplicationVersion header sent with the API requests.

3) Modifying the API calls that accept and return plot/tree JSON to convert
choice values using the mapping defined in the CHOICE_CONVERSIONS setting
_only_ if the app version is below the specified threshold.

TODO: The pending values in the API responses are not yet being converted.
Apply string format to canopy search
Allow for localized postal code fields

Closes issue #38

Postal code types are now specified in settings as:
POSTAL_CODE_FIELD = "..."

It is decoded into actual field values in "localization.py"
Merge pull request #40 from ahinz/bug/zipcodes

Allow for localized postal code fields
Add in default settings, fixes #26
Remove "geopy_extensions"

This app is no longer used and isn't currently accessible. Any
new geocoding features will probably be based off of omgeo
Revamp readme for v1.3, fixes #8
Spell 'PostalCode' right
Add support for updating pending choice values

I extended the support for converting old choice values passed
in to the API to cover pending edits. To prevent duplicating
logic and to reduce indentation I refactored the
convert_plot_dict_choice_values function.
Merge pull request #41 from ahinz/bug/missing-settings

Settings and misc cleanup
Merge branch 'topic/convert-choices' of git://github.com/jwalgran/OpenTreeMap into jwalgran-topic/convert-choices
Fix failures when settings.CHOICE_CONVERSIONS is not defined

The CHOICE_CONVERSIONS setting is completely optional but there were places
in the API code that expected the setting to exist.