Added handler base class and file-based subclass.

Sorry about the huge commit, I'll start a branch for the next one, I
promise. :D Also fixes a null pointer exception in HTTPRequest.