Tests for the staticResourceHandler.

Don't really like the size of this module at the moment, the
wasFileModified function needs separating, and there are too many
dependencies at the top level. I'll do some refactoring once there's
better test coverage elsewhere.
Made the deferred object chainable.

Should make testing a little easier when needing mocked deferreds.