made config.json optional
added lib middleware dir to middleware sources