Custome middleware support

 - API to specify server's custom middlewares.
 - Mocha tests.