added 2004 district 20 correction
Remove duplicate call to handle_task

handle_task() was being called twice in datasource.mappings task.

Spotted by @tothebeat and someone else at the hackathon.  Thanks!
Merge remote-tracking branch 'openelex/dev' into dev
Use bulk inserts and cached lookup for created models

To speed things up, use bulk inserts to create new
Contest, Candidate and Result records. Generate keys and use
a set to avoid duplicates.

In order ot create lookup keys, I had to improve
RawResult.candidate_slug and RawResult.contest_slug. I also had
to work around a case where some results had a (seemingly)
erroneous "Office District" field for offices that shouldn't have
districts, like President. See #80.

Finally, add logic to set the ocd_id for the result records. In
the case of precincts, I decided to pass the parent county of the
district (which is available at the load stage in the mapping)
to the transform stage via an expando field, RawResult.count_ocd_id.
It seemed wasteful to have to look this up since the precinct to
county relationship isn't otherwise available at the transform
stage.

Addresses #49
Remove reference to removed fields in Roller.

With the move to ``RawResult``, ``raw_full_name`` was being referenced
but no longer exists.

Addresses #49
Add flags field to Candidate

This will be used to unambiguously identify candidate records that
can be tied to non-person results, such as "Other Write-Ins" or
"None of the Above".

Closes #81
First pass at creating post-2002 MD results

This finishes a first pass at creating post-2002 Maryland Result
records from RawResult.

* Handle "Other Write-Ins" pseudo-candidate using Candidate.flags
* Batch bulk inserts. This didn't use to be a problem because we
  were just bulk-inserting on a file-by-file basis.  However, since
  we're working from RawResult records, there will be a lot more
  records inserted at once.
* Delete old records before creating new ones.  This still doesn't
  amount to a good atomic strategy, but it mimics the behavior of
  the old pre-rawresult loader.
* Pull the abbreviation from the Party object and use it to set
  Result.party.

Addresses #49
Don't lookup Reference.raw_result when baking.

Right now, we don't need any of those fields, so don't bother
resolving the reference.
Add additional_name field to RawResult

Maryland 2002 results provide last, middle and first names, but
no full name.  We need to capture the middle name in the initial
load.

Addresses #49
Clarify purpose of BaseLoader in docstring

Add notes to BaseLoader docstring that clarifies that it should:

* Create RawResults
* Only do minimal data cleaning/transforming such as striping
  whitepspace and converting vote counts to ints.

Also remove unused imports.

Addresses #49
Document data format for 2002 MD data

Make fields list passed to csv.DictReader align with the field
names on RawResult for easier construction later.

Also remove unused imports.

Addresses #49
Move setting of primary party out of _build_meta_fields()

The way that the row is fetched will vary from file to file, making
it hard to move this method to BaseLoader if we want to do that
in the end.

Addresses #49
s/_build_meta_fields/_build_common_election_kwargs/

Rename MDBaseLoader._build_meta_fields() to
MDBaseLoader._build_common_election_kwargs().

This is because we're ultimately building keyword arguments that
will being passed to the RawResult constructor.  Also, the _kwargs
naming convention is used in other similar cases.

I chose not to use the term "meta" because the keyword arguments
we're building include some information that will be in contest
records.  They're different than the fields labeled as meta in
models.  Ultimately, what they share is that they're common to a
particular election.

Addresses #49
Load 2002 Maryland elections to RawResult

Implement 2002 Maryland loader, loading results into RawResult
documents.

Addresses #49
Create 2002 MD contests and candidates

I was able to integrate this into the existing transforms
pretty easily.  For now, I think this is the right strategy.

Addresses #49
Create Maryland 2002 results from rawresult

Addresses #49
First pass at Maryland 2000 primary loader

Addresses #49
Add utility function for formatting OCD type IDs
Add congressional_district_by_county reporting level

Some Maryland primary results are provided by congressional
district, split by county, without any total for the congressional
district.  We need to clearly identify this case when storing
RawResult records so we can detect it in a transform.

Addresses #49, #80
Load Maryland 2000 results to RawResult

Account for results reported as county portion of congressional
district.

Addresses #49