Tornado 4.0 compatablity

Backported old Task class for Tornado 4.0 compatablity. This
will hold until we migrate to new interface
Merge pull request #76 from haizaar/master

Tornado 4.0 compatablity