Don't set time_started when not necessary

The state_changed mixin had a bug where it would set time_started for a
job to utcnow() every time a batch of task was assigned to an agent.
Use _WorkState instead of WorkState for comparison

job.state != WorkState.RUNNING never evaluated as true.
Fix some minor mistakes in a docstring
Show failures, last_error in tasks list
Merge pull request #231 from guidow/fix_resetting_started_time

Don't set time_started when not necessary
Merge pull request #234 from guidow/fix_docstring

Fix some minor mistakes in a docstring
Merge pull request #235 from guidow/more_cols_in_tasks_list

Show failures, last_error in tasks list
Drastically reduce SQL queries fired in schedule

With SQlite and 500 jobs, this reduces the scheduler's runtime from
>20s to <1s on my machine.
Start oldest waiting job first, not youngest
Bugfix: Do not try to assign when job has no tasks

This bug would prevent the scheduler from running more than one job in
the same queue simultaneously.
Do not exceed jobtype's max_batch

Even if the batch setting for the current job is higher than that.
Add locking on a lockfile for scheduler

This should prevent two copies of the scheduler from running at the same
time.
Will not work if there are multiple celery nodes in a cluster, though.
Minor fix to a comment
Use a configuration value for scheduler lockfile