Made testcases pytest compatible

Fixes #323. Had to make some `from bookie.bcelery import tasks` statements local to method definitions. The reason, as I found out, was that importing `tasks` lead to execution of some global statements which prevented pytest from working.