Add support for pluggable middlewares. fixes #16, #12, #11, #5, #1
Merge branch 'master' into plugins

Conflicts:
	Makefile
Merge branch 'plugins'