Split queries into Agenda and TODO list types.

The eventual goal is to allow for construction of most queries provided
by Emacs Org Mode's variable org-agenda-custom-commands. Toward this
goal, we have added a few options and views for them to the Agenda entry
settings.

Don't convert all day events to UTC. Doing so makes them come after
events starting at midnight (00:00) of the same day in timezones east of
UTC, and before such events in timezones west of UTC. By default, Emacs
Org Mode converts dates to days since the epoch, but it can use seconds,
(org-agenda-todo-ignore-time-comparison-use-seconds), so it is important
to know what time zone it uses. The last element of decode-time's return
value is "an integer indicating the number of seconds east of
Greenwich," which (decode-time (current-time)) gives as -25200
(GMT-7:00, MST) on my system. Therefore Emacs calculates times in the
local time zone. We should emulate this behavior so the same entries
appear in our agenda queries as in Org Mode's.
Add deadline warning days to agenda; bugfixes

Query events for the agenda that are due in some number of days.

Include completed items that have a date within the span.

Fix bug in spanToNDays where for span == "Month" or "Year" the sign is
wrong. Fix another bug that when span == "Month" or "Year", nDays == 0.

Fix database connection leaks (seen in logcat when running an agenda
query after previously running one (either the same or another)). Make
sure we close the db in AgendaFragment and wrap OrgQueryBuilder's
cursor.close() in a finally block.

Prevent repeated allocation and deallocation of the variables in
matchesAgendaQuery by combining it with its calling method, getNodes,
and moving the variables outside the loop.
Merge branch 'agenda-query-type-agenda' of https://github.com/imd/mobileorg-android into agenda
Made dropbox wizard work with new android API.