Start splitting up tasklib.py

- exceptions have their own file
- the global env dict has it's own file (to stop circular dependencies)
- link_local_settings() is the first function to move out
Convert tasks.py to use docopt
tasks: give helpful error message when project_settings can't be found
Split out various functions from tasklib.py

These are the ones that can be simply moved, without worrying about
circular dependencies.
Split database stuff out cleanly

So database stuff only imports from exceptions and utils.  The database
settings have to be set from the outside - currently done by functions
in django.

Django can then use the database functions cleanly, so more stuff has
been moved into django.
Sort out some confusion following mysql refactor
Start testing of database functions

And fix up a few other bits and bobs
Fix tasks test - docopt does system exit on help
Major refactor of database functions

Now we only execute inside a virtualenv, we can ensure we have the MySQL
python libraries available.  Which means we can use them rather than
having to go through the command line interface (apart from mysql dump
and restore).

Somewhat untested right now ...
Remove tests that relied on behaviour removed in last commit
Refactor _get_mysql_root_password()

Split out the functionality to get file contents and to ask the user for
the password into separate functions in util.

Also have a maximum number of attempts that the user gets to enter the
password.
Add tests for database functions

And fix the bugs that popped up.
Test more db user functions

And fix bug that came up
Add test for grant_all_privileges to database
Test create_db_if_not_exists()
Add tests for create_db_if_not_exists()
add tests for drop_db()
add test for db_table_exists() (and fix errors)
add test for mysqldump cron job text
restore old help text printing