(refactoring): real functional and composition for request handler

includes additional tests and a first draft for static file handling